diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 606bd4cc3b52d..b1e7c8a51f52c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -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")