Skip to content

Add case_when function/method #9

@andywong36

Description

@andywong36

https://www.rdocumentation.org/packages/dplyr/versions/1.0.10/topics/case_when

As an alternative to

def get_bound_status(df: pd.Series) -> str: 
""" returns one of ['upper', 'lower', 'none'] """
  ...

model_matrix = (
  model_matrix
  .assign(bounded_by = lambda df: df.apply(get_bound_status, axis=1))
)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions