Skip to content

Rename 'aggregate_function' parameter to 'agg' (API consistency) #25467

@juansolm

Description

@juansolm

Description

Pivot() has the parameter 'aggregate_function'
https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.pivot.html

This notation seems to be only in use for pivot:
https://docs.pola.rs/api/python/stable/search.html?q=aggregate_function

Most of the API however uses 'agg'
This is easier to use, clear to understand, and more consistent across the entire API
https://docs.pola.rs/api/python/stable/search.html?q=agg

Current

df.pivot("col", index="ix", aggregate_function="sum")

New

df.pivot("col", index="ix", agg="sum")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or an improvement of an existing featureneeds decisionAwaiting decision by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions