GroupBy objects are returned by groupby calls: pandas.DataFrame.groupby(), pandas.Series.groupby(), etc.
pandas.DataFrame.groupby()
pandas.Series.groupby()
GroupBy.__iter__()
GroupBy.__iter__
Groupby iterator.
GroupBy.groups
Dict {group name -> group labels}.
GroupBy.indices
Dict {group name -> group indices}.
GroupBy.get_group(name[, obj])
GroupBy.get_group
Construct DataFrame from group with provided name.
Grouper(*args, **kwargs)
Grouper
A Grouper allows the user to specify a groupby instruction for an object.
GroupBy.apply(func, *args, **kwargs)
GroupBy.apply
Apply function func group-wise and combine the results together.
GroupBy.agg(func, *args, **kwargs)
GroupBy.agg
SeriesGroupBy.aggregate([func, engine, …])
SeriesGroupBy.aggregate
Aggregate using one or more operations over the specified axis.
DataFrameGroupBy.aggregate([func, engine, …])
DataFrameGroupBy.aggregate
SeriesGroupBy.transform(func, *args[, …])
SeriesGroupBy.transform
Call function producing a like-indexed Series on each group and return a Series having the same indexes as the original object filled with the transformed values
DataFrameGroupBy.transform(func, *args[, …])
DataFrameGroupBy.transform
Call function producing a like-indexed DataFrame on each group and return a DataFrame having the same indexes as the original object filled with the transformed values
GroupBy.pipe(func, *args, **kwargs)
GroupBy.pipe
Apply a function func with arguments to this GroupBy object and return the function’s result.
GroupBy.all([skipna])
GroupBy.all
Return True if all values in the group are truthful, else False.
GroupBy.any([skipna])
GroupBy.any
Return True if any value in the group is truthful, else False.
GroupBy.bfill([limit])
GroupBy.bfill
Backward fill the values.
GroupBy.backfill([limit])
GroupBy.backfill
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([axis])
GroupBy.cummax
Cumulative max for each group.
GroupBy.cummin([axis])
GroupBy.cummin
Cumulative min for each group.
GroupBy.cumprod([axis])
GroupBy.cumprod
Cumulative product for each group.
GroupBy.cumsum([axis])
GroupBy.cumsum
Cumulative sum for each group.
GroupBy.ffill([limit])
GroupBy.ffill
Forward fill the values.
GroupBy.first([numeric_only, min_count])
GroupBy.first
Compute first of group values.
GroupBy.head([n])
GroupBy.head
Return first n rows of each group.
GroupBy.last([numeric_only, min_count])
GroupBy.last
Compute last of group values.
GroupBy.max([numeric_only, min_count])
GroupBy.max
Compute max of group values.
GroupBy.mean([numeric_only])
GroupBy.mean
Compute mean of groups, excluding missing values.
GroupBy.median([numeric_only])
GroupBy.median
Compute median of groups, excluding missing values.
GroupBy.min([numeric_only, min_count])
GroupBy.min
Compute min of group values.
GroupBy.ngroup([ascending])
GroupBy.ngroup
Number each group from 0 to the number of groups - 1.
GroupBy.nth(n[, dropna])
GroupBy.nth
Take the nth row from each group if n is an int, or a subset of rows if n is a list of ints.
GroupBy.ohlc()
GroupBy.ohlc
Compute open, high, low and close values of a group, excluding missing values.
GroupBy.pad([limit])
GroupBy.pad
GroupBy.prod([numeric_only, min_count])
GroupBy.prod
Compute prod of group values.
GroupBy.rank([method, ascending, na_option, …])
GroupBy.rank
Provide the rank of values within each group.
GroupBy.pct_change([periods, fill_method, …])
GroupBy.pct_change
Calculate pct_change of each value to previous entry in group.
GroupBy.size()
GroupBy.size
Compute group sizes.
GroupBy.sem([ddof])
GroupBy.sem
Compute standard error of the mean of groups, excluding missing values.
GroupBy.std([ddof])
GroupBy.std
Compute standard deviation of groups, excluding missing values.
GroupBy.sum([numeric_only, min_count])
GroupBy.sum
Compute sum of group values.
GroupBy.var([ddof])
GroupBy.var
Compute variance of groups, excluding missing values.
GroupBy.tail([n])
GroupBy.tail
Return last n rows of 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.
SeriesGroupBy
DataFrameGroupBy
DataFrameGroupBy.all([skipna])
DataFrameGroupBy.all
DataFrameGroupBy.any([skipna])
DataFrameGroupBy.any
DataFrameGroupBy.backfill([limit])
DataFrameGroupBy.backfill
DataFrameGroupBy.bfill([limit])
DataFrameGroupBy.bfill
DataFrameGroupBy.corr
Compute pairwise correlation of columns, excluding NA/null values.
DataFrameGroupBy.count()
DataFrameGroupBy.count
DataFrameGroupBy.cov
Compute pairwise covariance of columns, excluding NA/null values.
DataFrameGroupBy.cumcount([ascending])
DataFrameGroupBy.cumcount
DataFrameGroupBy.cummax([axis])
DataFrameGroupBy.cummax
DataFrameGroupBy.cummin([axis])
DataFrameGroupBy.cummin
DataFrameGroupBy.cumprod([axis])
DataFrameGroupBy.cumprod
DataFrameGroupBy.cumsum([axis])
DataFrameGroupBy.cumsum
DataFrameGroupBy.describe(**kwargs)
DataFrameGroupBy.describe
Generate descriptive statistics.
DataFrameGroupBy.diff
First discrete difference of element.
DataFrameGroupBy.ffill([limit])
DataFrameGroupBy.ffill
DataFrameGroupBy.fillna
Fill NA/NaN values using the specified method.
DataFrameGroupBy.filter(func[, dropna])
DataFrameGroupBy.filter
Return a copy of a DataFrame excluding filtered elements.
DataFrameGroupBy.hist
Make a histogram of the DataFrame’s.
DataFrameGroupBy.idxmax
Return index of first occurrence of maximum over requested axis.
DataFrameGroupBy.idxmin
Return index of first occurrence of minimum over requested axis.
DataFrameGroupBy.mad
Return the mean absolute deviation of the values for the requested axis.
DataFrameGroupBy.nunique([dropna])
DataFrameGroupBy.nunique
Return DataFrame with counts of unique elements in each position.
DataFrameGroupBy.pad([limit])
DataFrameGroupBy.pad
DataFrameGroupBy.pct_change([periods, …])
DataFrameGroupBy.pct_change
DataFrameGroupBy.plot
Class implementing the .plot attribute for groupby objects.
DataFrameGroupBy.quantile([q, interpolation])
DataFrameGroupBy.quantile
Return group values at the given quantile, a la numpy.percentile.
DataFrameGroupBy.rank([method, ascending, …])
DataFrameGroupBy.rank
DataFrameGroupBy.resample(rule, *args, **kwargs)
DataFrameGroupBy.resample
Provide resampling when using a TimeGrouper.
DataFrameGroupBy.sample([n, frac, replace, …])
DataFrameGroupBy.sample
Return a random sample of items from each group.
DataFrameGroupBy.shift([periods, freq, …])
DataFrameGroupBy.shift
Shift each group by periods observations.
DataFrameGroupBy.size()
DataFrameGroupBy.size
DataFrameGroupBy.skew
Return unbiased skew over requested axis.
DataFrameGroupBy.take
Return the elements in the given positional indices along an axis.
DataFrameGroupBy.tshift
(DEPRECATED) Shift the time index, using the index’s frequency if available.
The following methods are available only for SeriesGroupBy objects.
SeriesGroupBy.hist
Draw histogram of the input series using matplotlib.
SeriesGroupBy.nlargest
Return the largest n elements.
SeriesGroupBy.nsmallest
Return the smallest n elements.
SeriesGroupBy.nunique([dropna])
SeriesGroupBy.nunique
Return number of unique elements in the group.
SeriesGroupBy.unique
Return unique values of Series object.
SeriesGroupBy.value_counts([normalize, …])
SeriesGroupBy.value_counts
SeriesGroupBy.is_monotonic_increasing
Alias for is_monotonic.
SeriesGroupBy.is_monotonic_decreasing
Return boolean if values in the object are monotonic_decreasing.
The following methods are available only for DataFrameGroupBy objects.
DataFrameGroupBy.corrwith
Compute pairwise correlation.
DataFrameGroupBy.boxplot([subplots, column, …])
DataFrameGroupBy.boxplot
Make box plots from DataFrameGroupBy data.