pandas.api.typing.SeriesGroupBy#
- class pandas.api.typing.SeriesGroupBy(
- obj,
- keys=None,
- level=None,
- grouper=None,
- exclusions=None,
- selection=None,
- as_index=True,
- sort=True,
- group_keys=True,
- observed=True,
- dropna=True,
Groupby object for a Series.
Returned by
Series.groupbyand by selecting a single column of aDataFrameGroupBy. This is not meant to be instantiated directly.See GroupBy for the available methods and Group by: split-apply-combine for the user guide.
See also
pandas.Series.groupbyGroup Series using a mapper or by a Series of columns.
pandas.api.typing.DataFrameGroupByGroupby object for a DataFrame.
Examples
>>> ser = pd.Series([1, 2, 3], index=["a", "a", "b"]) >>> ser.groupby(level=0).sum() a 3 b 3 dtype: int64