Table Of Contents


Enter search terms or a module, class or function name.


DataFrameGroupBy.agg(arg, *args, **kwargs)[source]

Aggregate using input function or dict of {column -> function}


arg : function or dict

Function to use for aggregating groups. If a function, must either work when passed a DataFrame or when passed to DataFrame.apply. If passed a dict, the keys must be DataFrame column names.

Accepted Combinations are:
  • string cythonized function name
  • function
  • list of functions
  • dict of columns -> functions
  • nested dict of names -> dicts of functions

aggregated : DataFrame


Numpy functions mean/median/prod/sum/std/var are special cased so the default behavior is applying the function along axis=0 (e.g., np.mean(arr_2d, axis=0)) as opposed to mimicking the default Numpy behavior (e.g., np.mean(arr_2d)).

Scroll To Top