DataFrame.
aggregate
Aggregate using one or more operations over the specified axis.
Function to use for aggregating the data. If a function, must either work when passed a %(klass)s or when passed to %(klass)s.apply.
Accepted combinations are:
function
string function name
list of functions and/or function names, e.g. [np.sum, 'mean']
[np.sum, 'mean']
dict of axis labels -> functions, function names or list of such.
Currently, we only support ['count', 'mad', 'max', 'mean', 'median', 'min', 'mode', 'quantile', 'rank', 'sem', 'skew', 'sum', 'std', 'var']
['count', 'mad', 'max', 'mean', 'median', 'min', 'mode', 'quantile', 'rank', 'sem', 'skew', 'sum', 'std', 'var']
Currently, we only support axis=0 (index)
Positional arguments to pass to func
Keyword arguments to pass to func
if DataFrame.agg is called with a single function, returns a Series if DataFrame.agg is called with several functions, returns a DataFrame if Series.agg is called with single function, returns a scalar if Series.agg is called with several functions, returns a Series
See also
Examples
>>> df = ed.DataFrame('localhost', 'flights') >>> df[['DistanceKilometers', 'AvgTicketPrice']].aggregate(['sum', 'min', 'std']).astype(int) DistanceKilometers AvgTicketPrice sum 92616288 8204364 min 0 100 std 4578 266