Group DataFrame using a mapper or by a Series of columns.
A groupby operation involves some combination of splitting the object, applying a function, and combining the results. This can be used to group large amounts of data and compute operations on these groups.
-
by : mapping, function, label, or list of labes
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
orSeries
is passed, the Series or dict VALUES will be used to determine the groups.If an
ndarray
is passed, the values are used as-is determine the groups.A label or list of labels may be passed to group by the columns in self.
-
axis