Skip to content

Commit

Permalink
polars: rolling_apply -> rolling_map
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Jul 17, 2024
1 parent 9ce36ac commit 9a33256
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pytimetk/feature_engineering/expanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _augment_expanding_polars(
# Construct expanding window expression
expanding_expr = pl.col(col) \
.cast(pl.Float64) \
.rolling_apply(
.rolling_map(
function=func,
window_size=pandas_df.shape[0],
min_periods=min_periods
Expand Down
3 changes: 2 additions & 1 deletion src/pytimetk/feature_engineering/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def _augment_rolling_polars(
# Construct rolling window expression
rolling_expr = pl.col(col) \
.cast(pl.Float64) \
.rolling_apply(
.rolling_map(
function=func,
window_size=window_size,
min_periods=min_periods
Expand Down Expand Up @@ -500,6 +500,7 @@ def _augment_rolling_polars(

rolling_expr = rolling_expr.alias(new_column_name)

# Standard Functions: "mean", "std"
elif isinstance(func, str):
func_name = func
new_column_name = f"{col}_rolling_{func_name}_win_{window_size}"
Expand Down

0 comments on commit 9a33256

Please sign in to comment.