Supported Aggregation Functions

This page lists which aggregation functions are supported by DataFrame.agg; Series.agg; DataFrameGroupBy.agg; SeriesGroupBy.agg; and the pivot methods pd.pivot_table, DataFrame.pivot_table, and pd.crosstab.

Note

Y stands for yes (supports distributed implementation), N stands for no (API simply errors out), and P stands for partial (meaning some parameters may not be supported yet).

Both Python builtin and NumPy functions are supported for DataFrameGroupBy.agg and SeriesGroupBy.agg.

Aggregation Function

DataFrame.agg supports? (Y/N/P)

Series.agg supports? (Y/N/P)

DataFrameGroupBy.agg supports? (Y/N/P)

SeriesGroupBy.agg supports? (Y/N/P)

pivot methods support? (Y/N/P)

count

Y for axis=0. For axis=1, Y if index is not a MultiIndex.

Y

Y

Y

Y

mean

Y for axis=0. N for axis=1.

Y

Y

Y

Y

min

Y for axis=0. For axis=1, Y if index is not a MultiIndex.

Y

Y

Y

Y

max

Y for axis=0. For axis=1, Y if index is not a MultiIndex.

Y

Y

Y

Y

sum

Y for axis=0. For axis=1, Y if index is not a MultiIndex.

Y

Y

Y

Y

median

Y for axis=0. N for axis=1.

Y

Y

Y

Y

size

Y for axis=0. N for axis=1.

Y

Y

Y

N

std

P for axis=0 - only when ddof=0 or ddof=1. N for axis=1.

P - only when ddof=0 or ddof=1.

P - only when ddof=0 or ddof=1.

P - only when ddof=0 or ddof=1.

Y

var

P for axis=0 - only when ddof=0 or ddof=1. N for axis=1.

P - only when ddof=0 or ddof=1.

P - only when ddof=0 or ddof=1.

P - only when ddof=0 or ddof=1.

Y

quantile

P for axis=0 - only when q is the default value or a scalar. N for axis=1.

P - only when q is the default value or a scalar.

P - only when q is the default value or a scalar.

P - only when q is the default value or a scalar.

N

len

Y

Y

Y

Y

N