pandas 1.4.2

NotesParametersReturnsBackRef
aggregate(self, func=None, axis=0, *args, **kwargs)

Notes

:None:None:`agg` is an alias for aggregate . Use the alias.

Functions that mutate the passed object can produce unexpected behavior or errors and are not supported. See gotchas.udf-mutation for more details.

A passed user-defined-function will be passed a Series for evaluation.

Parameters

func : function, str, list or dict

Function to use for aggregating the data. If a function, must either work when passed a Series or when passed to Series.apply.

Accepted combinations are:

  • function

  • string function name

  • list of functions and/or function names, e.g. [np.sum, 'mean']

  • dict of axis labels -> functions, function names or list of such.

axis : {0 or 'index'}

Parameter needed for compatibility with DataFrame.

*args :

Positional arguments to pass to func .

**kwargs :

Keyword arguments to pass to func .

Returns

scalar, Series or DataFrame

The return can be:

Aggregate using one or more operations over the specified axis.

See Also

Series.apply

Invoke function on a Series.

Series.transform

Transform function producing a Series with like indexes.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series([1, 2, 3, 4])
... s 0 1 1 2 2 3 3 4 dtype: int64
This example is valid syntax, but we were not able to check execution
>>> s.agg('min')
1
This example is valid syntax, but we were not able to check execution
>>> s.agg(['min', 'max'])
min   1
max   4
dtype: int64
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.window.expanding.Expanding.aggregate pandas.core.series.Series.aggregate pandas.core.series.Series.apply pandas.core.series.Series.transform pandas.core.window.rolling.Window.aggregate

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/series.py#4287
type: <class 'function'>
Commit: