Skip to content

[Enh]: add Expr.first #2526

Open
Open
@MathiasHolmstrom

Description

@MathiasHolmstrom

I often find myself desiring a .first() expression. Is there a plan to support that expression?

Polars Example

df = pl.DataFrame(
    {
        "group": ["A", "A", "A", "B", "B", "B"],
        "value": [1, 2, 3, 4, 5, 6],
    }
)
df = df.with_columns(
    pl.col("value").first().over("group").alias("mean_value")
)

Related

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