Skip to content

[Enh]: Allow LazyFrame.with_row_index(..., order_by=...) #2307

@FBruzzesi

Description

@FBruzzesi

Description

Proposing to allow the following: LazyFrame.with_row_index(name, order_by=into_exprs)

This would be a deviation from polars itself.
In a way this is similar to #2174

Suggested implementation

I am missing some detail for sure, but it would be something close to:

self.with_column(**{name: nw.lit(1).cum_sum().over(order_by=order_by) - 1})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthigh priorityYour PR will be reviewed very quickly if you address thisroad to v2What takes us closer to `stable.v2` (high prio)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions