pandas.api.typing.SeriesGroupBy.apply

pandas 3.1.1 · GroupBy · method

Call a function with each grouped Series and assemble the results.

Call syntax

pd.api.typing.SeriesGroupBy.apply(func, *args, **kwargs)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
func Required
Positional or keyword
callable

Supply a supported operation name or a callable, depending on this API.

*args Optional
Additional positional arguments
**kwargs Optional
Additional keyword arguments

Returns

Series or DataFrame