Skip to content

[Enh]: Support DataFrame|LazyFrame.rolling #2544

Open
@rwhitten577

Description

@rwhitten577

We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below?

Calculate temporal rolling aggregations where the windows are not constant, e.g. "count of clicks over past 3 days by user"

Please describe the purpose of the new feature or describe the problem to solve.

Polars has .rolling on DataFrame/LazyFrames: https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.rolling.html

Would be great to support this in Narwhals for easy temporal aggregations. This is the equivalent of a range between interval window function and should be supported by many backends (duckdb, spark, ibis, etc).

Suggest a solution if possible.

No response

If you have tried alternatives, please describe them below.

No response

Additional information that may help us understand your needs.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions