Skip to content

Define pl.enum inside a function #75

Description

@uriahf

The following code chunk should be implemented in a function


reals_enum_dtype = aj_data_combinations.schema["reals_labels"]
censoring_assumptions_enum_dtype = aj_data_combinations.schema["censoring_assumption"]
competing_assumptions_enum_dtype = aj_data_combinations.schema["competing_assumption"]

strata_enum_dtype = aj_data_combinations.schema["strata"]


aj_estimates_data = aj_estimates_data.with_columns([
    pl.col("strata")
]).with_columns(
    pl.col("reals_labels").str.replace(r"_est$", "").cast(reals_enum_dtype)
).with_columns(
  pl.col("censoring_assumption").cast(censoring_assumptions_enum_dtype)
).with_columns(
  pl.col("competing_assumption").cast(competing_assumptions_enum_dtype)
).with_columns(
  pl.col("strata").cast(strata_enum_dtype)
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions