GroupBy objects are returned by groupby calls: DataFrame.groupby(), Series.groupby(), etc.
DataFrame.groupby()
Series.groupby()
GroupBy.get_group(name)
GroupBy.get_group
Construct DataFrame from group with provided name.
GroupBy.apply(func, *args, **kwargs)
GroupBy.apply
Apply function func group-wise and combine the results together.
GroupBy.transform(func, *args, **kwargs)
GroupBy.transform
Apply function column-by-column to the GroupBy object.
The following methods are available only for DataFrameGroupBy objects.
DataFrameGroupBy.agg([func_or_funcs])
DataFrameGroupBy.agg
Aggregate using one or more operations over the specified axis.
DataFrameGroupBy.aggregate([func_or_funcs])
DataFrameGroupBy.aggregate
GroupBy.all()
GroupBy.all
Returns True if all values in the group are truthful, else False.
GroupBy.any()
GroupBy.any
Returns True if any value in the group is truthful, else False.
GroupBy.count()
GroupBy.count
Compute count of group, excluding missing values.
GroupBy.cumcount([ascending])
GroupBy.cumcount
Number each item in each group from 0 to the length of that group - 1.
GroupBy.cummax()
GroupBy.cummax
Cumulative max for each group.
GroupBy.cummin()
GroupBy.cummin
Cumulative min for each group.
GroupBy.cumprod()
GroupBy.cumprod
Cumulative product for each group.
GroupBy.cumsum()
GroupBy.cumsum
Cumulative sum for each group.
GroupBy.filter(func)
GroupBy.filter
Return a copy of a DataFrame excluding elements from groups that do not satisfy the boolean criterion specified by func.
GroupBy.first()
GroupBy.first
Compute first of group values.
GroupBy.last()
GroupBy.last
Compute last of group values.
GroupBy.max()
GroupBy.max
Compute max of group values.
GroupBy.mean()
GroupBy.mean
Compute mean of groups, excluding missing values.
GroupBy.median([numeric_only, accuracy])
GroupBy.median
Compute median of groups, excluding missing values.
GroupBy.min()
GroupBy.min
Compute min of group values.
GroupBy.rank([method, ascending])
GroupBy.rank
Provide the rank of values within each group.
GroupBy.std([ddof])
GroupBy.std
Compute standard deviation of groups, excluding missing values.
GroupBy.sum()
GroupBy.sum
Compute sum of group values
GroupBy.var([ddof])
GroupBy.var
Compute variance of groups, excluding missing values.
GroupBy.nunique([dropna])
GroupBy.nunique
Return DataFrame with number of distinct observations per group for each column.
GroupBy.size()
GroupBy.size
Compute group sizes.
GroupBy.diff([periods])
GroupBy.diff
First discrete difference of element.
GroupBy.idxmax([skipna])
GroupBy.idxmax
Return index of first occurrence of maximum over requested axis in group.
GroupBy.idxmin([skipna])
GroupBy.idxmin
Return index of first occurrence of minimum over requested axis in group.
GroupBy.fillna([value, method, axis, …])
GroupBy.fillna
Fill NA/NaN values in group.
GroupBy.bfill([limit])
GroupBy.bfill
Synonym for DataFrame.fillna() with method=`bfill`.
method=`bfill`
GroupBy.ffill([limit])
GroupBy.ffill
Synonym for DataFrame.fillna() with method=`ffill`.
method=`ffill`
GroupBy.head([n])
GroupBy.head
Return first n rows of each group.
GroupBy.backfill([limit])
GroupBy.backfill
GroupBy.shift([periods, fill_value])
GroupBy.shift
Shift each group by periods observations.
GroupBy.tail([n])
GroupBy.tail
Return last n rows of each group.
DataFrameGroupBy.describe()
DataFrameGroupBy.describe
Generate descriptive statistics that summarize the central tendency, dispersion and shape of a dataset’s distribution, excluding NaN values.
NaN
The following methods are available only for SeriesGroupBy objects.
SeriesGroupBy.nsmallest([n])
SeriesGroupBy.nsmallest
Return the smallest n elements.
SeriesGroupBy.nlargest([n])
SeriesGroupBy.nlargest
Return the first n rows ordered by columns in descending order in group.
SeriesGroupBy.value_counts([sort, …])
SeriesGroupBy.value_counts
SeriesGroupBy.unique()
SeriesGroupBy.unique
Return unique values in group.