Skip to content

Imputation

polars_ts.imputation

Group-aware missing value imputation for time series. Closes #60.

impute(df, target_col='y', method='forward_fill', id_col='unique_id', time_col='ds', season_length=None, add_indicator=False)

Impute missing values in a time series DataFrame.

Parameters

df Input DataFrame. target_col Column to impute. method Imputation method: "forward_fill", "backward_fill", "linear", "mean", "median", or "seasonal". id_col Column identifying each time series. time_col Column with timestamps for ordering. season_length Required when method="seasonal". add_indicator If True, add a boolean {target_col}_imputed column.

Returns

pl.DataFrame DataFrame with missing values imputed.