polars.get_dummies#

polars.get_dummies(df: DataFrame, *, columns: Optional[list[str]] = None) DataFrame[source]#

Convert categorical variables into dummy/indicator variables.

Parameters:
df

DataFrame to convert.

columns

A subset of columns to convert to dummy variables. None means “all columns”.