dtoolkit.accessor.series.groupby_index#
- dtoolkit.accessor.series.groupby_index(s: Series, /, **kwargs) SeriesGroupBy [source]#
Group Series by its index.
- Parameters:
- **kwargs
See the documentation for
groupby()
for complete details on the keyword arguments exceptby
.
- Returns:
- SeriesGroupBy
Notes
by
parameter is set tos.index
and can’t be overridden.Examples
>>> import dtoolkit >>> import pandas as pd >>> s = pd.Series([1, 1, 1], index=['a', 'b', 'a']) >>> s a 1 b 1 a 1 dtype: int64 >>> s.groupby_index().count() a 2 b 1 dtype: int64