GroupBy

GroupBy objects are returned by groupby calls: cudf.DataFrame.groupby(), cudf.Series.groupby(), etc.

Indexing, iteration

GroupBy.__iter__()

GroupBy.groups

Like @property, but only evaluated upon first invocation.

Grouper([key, level])

Function application

GroupBy.apply(function)

Apply a python transformation function over the grouped chunk.

GroupBy.agg(func)

Apply aggregation(s) to the groups.

SeriesGroupBy.aggregate(func)

Apply aggregation(s) to the groups.

DataFrameGroupBy.aggregate(func)

Apply aggregation(s) to the groups.

GroupBy.pipe(func, *args, **kwargs)

Apply a function func with arguments to this GroupBy object and return the function’s result.

Computations / descriptive stats

GroupBy.bfill([limit])

Backward fill NA values.

GroupBy.backfill([limit])

Backward fill NA values.

GroupBy.count([dropna])

Compute the number of values in each column.

GroupBy.cumcount()

Return the cumulative count of keys in each group.

GroupBy.cummax()

Get the column-wise cumulative maximum value in each group.

GroupBy.cummin()

Get the column-wise cumulative minimum value in each group.

GroupBy.cumsum()

Compute the column-wise cumulative sum of the values in each group.

GroupBy.ffill([limit])

Forward fill NA values.

GroupBy.max()

Get the column-wise maximum value in each group.

GroupBy.mean()

Compute the column-wise mean of the values in each group.

GroupBy.median()

Get the column-wise median of the values in each group.

GroupBy.min()

Get the column-wise minimum value in each group.

GroupBy.nth(n)

Return the nth row from each group.

GroupBy.pad([limit])

Forward fill NA values.

GroupBy.prod()

Compute the column-wise product of the values in each group.

GroupBy.size()

Return the size of each group.

GroupBy.std([ddof])

Compute the column-wise std of the values in each group.

GroupBy.sum()

Compute the column-wise sum of the values in each group.

GroupBy.var([ddof])

Compute the column-wise variance of the values in each group.

The following methods are available in both SeriesGroupBy and DataFrameGroupBy objects, but may differ slightly, usually in that the DataFrameGroupBy version usually permits the specification of an axis argument, and often an argument indicating whether to restrict application to columns of a specific data type.

DataFrameGroupBy.backfill([limit])

Backward fill NA values.

DataFrameGroupBy.bfill([limit])

Backward fill NA values.

DataFrameGroupBy.count([dropna])

Compute the number of values in each column.

DataFrameGroupBy.cumcount()

Return the cumulative count of keys in each group.

DataFrameGroupBy.cummax()

Get the column-wise cumulative maximum value in each group.

DataFrameGroupBy.cummin()

Get the column-wise cumulative minimum value in each group.

DataFrameGroupBy.cumsum()

Compute the column-wise cumulative sum of the values in each group.

DataFrameGroupBy.describe([include, exclude])

Generate descriptive statistics that summarizes the central tendency, dispersion and shape of a dataset’s distribution, excluding NaN values.

DataFrameGroupBy.ffill([limit])

Forward fill NA values.

DataFrameGroupBy.fillna([value, method, ...])

Fill NA values using the specified method.

DataFrameGroupBy.idxmax()

Get the column-wise index of the maximum value in each group.

DataFrameGroupBy.idxmin()

Get the column-wise index of the minimum value in each group.

DataFrameGroupBy.nunique()

Return the number of unique values per group

DataFrameGroupBy.pad([limit])

Forward fill NA values.

DataFrameGroupBy.quantile([q, interpolation])

Compute the column-wise quantiles of the values in each group.

DataFrameGroupBy.shift([periods, freq, ...])

Shift each group by periods positions.

DataFrameGroupBy.size()

Return the size of each group.

The following methods are available only for SeriesGroupBy objects.

SeriesGroupBy.nunique()

Compute the number of unique values in each column in each group.

SeriesGroupBy.unique()

Get a list of the unique values for each column in each group.