-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
acceptedReady for implementationReady for implementationenhancementNew feature or an improvement of an existing featureNew feature or an improvement of an existing featureenterprise-supportPolars enterprise support requestedPolars enterprise support requested
Description
Description
I wanted to ask about a small ergonomics improvement around time-based rolling operations with nulls.
Example
import polars as pl
from datetime import datetime
df = pl.DataFrame(
{
"date": pl.datetime_range(
datetime(2025, 1, 1),
datetime(2025, 1, 5),
eager=True,
),
"x": [1.0, None, 3.0, 4.0, 5.0],
}
)
out = df.with_columns(
rolling = pl.col("x").rolling_mean_by(
by="date",
window_size="2d",
)
)
outThis currently errors with:
InvalidOperationError:
'Expr.rolling_*_by(...)' not yet supported for series with null values
Time based rolling is a very common operation so just wanted to request this as a quality-of-life request.
Metadata
Metadata
Assignees
Labels
acceptedReady for implementationReady for implementationenhancementNew feature or an improvement of an existing featureNew feature or an improvement of an existing featureenterprise-supportPolars enterprise support requestedPolars enterprise support requested