GroupBy#

GroupBy objects are returned by maxframe.liteframe.LiteFrame.groupby(). Aggregation output is always column-based (equivalent to as_index=False) with no MultiIndex — group keys are returned as regular columns.

Function application#

LiteFrameGroupBy.apply(func, *[, dtypes, ...])

Apply func to each group as a whole frame.

LiteFrameGroupBy.flat_apply(func, *[, ...])

Apply func to each row within each group, expanding it to 0-N rows.

LiteFrameGroupBy.apply_chunk(func, *[, ...])

GroupBy.apply_chunk() -- per-group-chunk application.

LiteFrameGroupBy.transform(func, *[, ...])

GroupBy.transform() -- per-group column transform.

LiteFrameGroupBy.transform_chunk(func, *[, ...])

GroupBy.transform_chunk() -- per-group-chunk transform.

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

Aggregate the grouped LiteFrame using one or more functions.

Computations / descriptive stats#

LiteFrameGroupBy.all(**kw)

Return True if all values in the group are truthy.

LiteFrameGroupBy.any(**kw)

Return True if any value in the group is truthy.

LiteFrameGroupBy.count(**kw)

Compute the count of non-null values in each group.

LiteFrameGroupBy.cumcount([ascending])

Cumulative count (0-indexed row number) within each group.

LiteFrameGroupBy.cummax([skipna, columns])

Cumulative maximum within each group.

LiteFrameGroupBy.cummin([skipna, columns])

Cumulative minimum within each group.

LiteFrameGroupBy.cumprod([skipna, columns])

Cumulative product within each group.

LiteFrameGroupBy.cumsum([skipna, columns])

Cumulative sum within each group.

LiteFrameGroupBy.max(**kw)

Compute the maximum of each group.

LiteFrameGroupBy.mean(**kw)

Compute the mean of each group.

LiteFrameGroupBy.median(**kw)

Compute the median of each group.

LiteFrameGroupBy.min(**kw)

Compute the minimum of each group.

LiteFrameGroupBy.nunique([dropna])

Compute the number of distinct values in each group.

LiteFrameGroupBy.prod(**kw)

Compute the product of each group.

LiteFrameGroupBy.rolling(window[, ...])

Provide rolling-window calculations within each group.

LiteFrameGroupBy.expanding([min_periods, ...])

Provide expanding window calculations within each group.

LiteFrameGroupBy.sem(**kw)

Compute the standard error of the mean of each group.

LiteFrameGroupBy.size(**kw)

Compute the number of rows in each group.

LiteFrameGroupBy.skew(**kw)

Compute the skewness of each group.

LiteFrameGroupBy.kurt(**kw)

Compute the kurtosis of each group.

LiteFrameGroupBy.std(**kw)

Compute the standard deviation of each group.

LiteFrameGroupBy.sum(**kw)

Compute the sum of each group.

LiteFrameGroupBy.var(**kw)

Compute the variance of each group.

Window transforms#

LiteFrameGroupBy.shift([periods, ...])

Shift rows within each group by periods positions.

LiteFrameGroupBy.diff([periods, columns])

Compute diff within each group.

LiteFrameGroupBy.pct_change([periods, columns])

Compute pct_change within each group.

LiteFrameGroupBy.ffill([limit, columns])

Forward-fill within each group.

LiteFrameGroupBy.bfill([limit, columns])

Backward-fill within each group.