Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7376,6 +7376,15 @@ def _gotitem(
min 1.0 2.0
sum 12.0 NaN

Aggregate different functions over the columns and rename the index of the resulting
DataFrame.

>>> df.agg(x=('A', max), y=('B', 'min'), z=('C', np.mean))
A B C
x 7.0 NaN NaN
y NaN 2.0 NaN
z NaN NaN 6.0

Aggregate over the columns.

>>> df.agg("mean", axis="columns")
Expand Down