Skip to content

DOC: Aggregate and rename is undocumented #35912

Closed
@rhshadrach

Description

@rhshadrach

The function DataFrame.agg allows for kwargs to aggregate and rename the results.

df = pd.DataFrame({'a': [1, 2, 3]})
print(df.agg(a_new=('a', 'sum')))

results in

       a
a_new  6

Perhaps I'm missing it, but I can't find it in both the API reference and the User Guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ApplyApply, Aggregate, Transform, MapDocs

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions