GroupBy#

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

Indexing, iteration#

DataFrameGroupBy.__iter__()

SeriesGroupBy.__iter__()

Function application helper#

NamedAgg(column, aggfunc)

Helper for column specific aggregation with control over output column names.

Function application#

SeriesGroupBy.apply(func, *args[, ...])

Apply function func group-wise and combine the results together.

DataFrameGroupBy.apply(func, *args[, ...])

Apply function func group-wise and combine the results together.

SeriesGroupBy.agg([func, method, combine_size])

Aggregate using one or more operations over the specified axis.

DataFrameGroupBy.agg([func, method, ...])

Aggregate using one or more operations over the specified axis.

SeriesGroupBy.aggregate([func, method, ...])

Aggregate using one or more operations over the specified axis.

DataFrameGroupBy.aggregate([func, method, ...])

Aggregate using one or more operations over the specified axis.

SeriesGroupBy.transform(f, *args[, dtypes, ...])

Call function producing a same-indexed Series on each group.

DataFrameGroupBy.transform(f, *args[, ...])

Call function producing a same-indexed DataFrame on each group.

DataFrameGroupBy computations / descriptive stats#

DataFrameGroupBy.all(**kw)

Return True if all values in the group are truthful, else False.

DataFrameGroupBy.any(**kw)

Return True if any value in the group is truthful, else False.

DataFrameGroupBy.backfill([limit])

DataFrameGroupBy.bfill([limit])

Backward fill the values.

DataFrameGroupBy.count(**kw)

Compute count of group, excluding missing values.

DataFrameGroupBy.cumcount([ascending])

Number each item in each group from 0 to the length of that group - 1.

DataFrameGroupBy.cummax([axis])

Cumulative max for each group.

DataFrameGroupBy.cummin([axis])

Cumulative min for each group.

DataFrameGroupBy.cumprod([axis])

Cumulative product for each group.

DataFrameGroupBy.cumsum([axis])

Cumulative sum for each group.

DataFrameGroupBy.ffill([limit])

Forward fill the values.

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

Fill NA/NaN values using the specified method within groups.

DataFrameGroupBy.head([n])

Return first n rows of each group.

DataFrameGroupBy.max(**kw)

Compute max of group values.

DataFrameGroupBy.mean(**kw)

Compute mean of groups, excluding missing values.

DataFrameGroupBy.min(**kw)

Compute min of group values.

DataFrameGroupBy.nth(n[, dropna])

Take the nth row from each group if n is an int, otherwise a subset of rows.

DataFrameGroupBy.nunique(**kw)

Return DataFrame with counts of unique elements in each position.

DataFrameGroupBy.prod(**kw)

Compute prod of group values.

DataFrameGroupBy.sample([n, frac, replace, ...])

Return a random sample of items from each group.

DataFrameGroupBy.sem(**kw)

Compute standard error of the mean of groups, excluding missing values.

DataFrameGroupBy.size(**kw)

Compute group sizes.

DataFrameGroupBy.skew(**kw)

Return unbiased skew within groups.

DataFrameGroupBy.std(**kw)

Compute standard deviation of groups, excluding missing values.

DataFrameGroupBy.sum(**kw)

Compute sum of group values.

DataFrameGroupBy.var(**kw)

Compute variance of groups, excluding missing values.

SeriesGroupBy computations / descriptive stats#

SeriesGroupBy.all(**kw)

Return True if all values in the group are truthful, else False.

SeriesGroupBy.any(**kw)

Return True if any value in the group is truthful, else False.

SeriesGroupBy.backfill([limit])

SeriesGroupBy.bfill([limit])

Backward fill the values.

SeriesGroupBy.count(**kw)

Compute count of group, excluding missing values.

SeriesGroupBy.cumcount([ascending])

Number each item in each group from 0 to the length of that group - 1.

SeriesGroupBy.cummax([axis])

Cumulative max for each group.

SeriesGroupBy.cummin([axis])

Cumulative min for each group.

SeriesGroupBy.cumprod([axis])

Cumulative product for each group.

SeriesGroupBy.cumsum([axis])

Cumulative sum for each group.

SeriesGroupBy.ffill([limit])

Forward fill the values.

SeriesGroupBy.fillna([value, method, limit])

Fill NA/NaN values using the specified method within groups.

SeriesGroupBy.head([n])

Return first n rows of each group.

SeriesGroupBy.max(**kw)

Compute max of group values.

SeriesGroupBy.mean(**kw)

Compute mean of groups, excluding missing values.

SeriesGroupBy.min(**kw)

Compute min of group values.

SeriesGroupBy.nth(n[, dropna])

Take the nth row from each group if n is an int, otherwise a subset of rows.

SeriesGroupBy.nunique(**kw)

Return number of unique elements in the group.

SeriesGroupBy.prod(**kw)

Compute prod of group values.

SeriesGroupBy.sample([n, frac, replace, ...])

Return a random sample of items from each group.

SeriesGroupBy.sem(**kw)

Compute standard error of the mean of groups, excluding missing values.

SeriesGroupBy.size(**kw)

Compute group sizes.

SeriesGroupBy.skew(**kw)

Return unbiased skew within groups.

SeriesGroupBy.std(**kw)

Compute standard deviation of groups, excluding missing values.

SeriesGroupBy.sum(**kw)

Compute sum of group values.

SeriesGroupBy.var(**kw)

Compute variance of groups, excluding missing values.

Plotting and visualization#