diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f1edfe276dfad..8b2a15e6d1666 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5092,14 +5092,15 @@ def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True, Parameters ---------- - by : mapping, function, str, or iterable + by : mapping, function, label, or list of labels Used to determine the groups for the groupby. If ``by`` is a function, it's called on each value of the object's index. If a dict or Series is passed, the Series or dict VALUES will be used to determine the groups (the Series' values are first aligned; see ``.align()`` method). If an ndarray is passed, the - values are used as-is determine the groups. A str or list of strs - may be passed to group by the columns in ``self`` + values are used as-is determine the groups. A label or list of + labels may be passed to group by the columns in ``self``. Notice + that a tuple is interpreted a (single) key. axis : int, default 0 level : int, level name, or sequence of such, default None If the axis is a MultiIndex (hierarchical), group by a particular