maxframe.liteframe.groupby.LiteFrameGroupBy.agg#
- LiteFrameGroupBy.agg(func=None, *, method='auto', numeric_only=None, input_frame_type='pandas', **kwargs)[source]#
Aggregate the grouped LiteFrame using one or more functions.
Supports string function names (e.g.
"sum","mean"), callables, or lists thereof. The result has one row per group with the group key columns prepended; no MultiIndex is produced.- Parameters:
func (str, callable, list, or dict, optional) – Aggregation specification. A string names a built-in reduction (
"sum","mean","min","max","prod","count","size","var","std","median","sem","skew","kurt","nunique","all","any"). A callable is applied per group. A list applies multiple aggregations to all (non-key) columns. A dict maps column names to function(s). If None, only the group keys are returned.method ({"auto", "shuffle", "map_reduce"}, default "auto") – Execution strategy for the aggregation.
numeric_only (bool or None, default None) – If True, only numeric columns are aggregated. If None, the default depends on the function.
input_frame_type ({"pandas", "polars"}, default "pandas") – Frame type passed to callable aggregations.
**kwargs – Additional keyword arguments forwarded to the aggregation function(s).
- Returns:
Lazy LiteFrame with one row per group and the aggregation results in the remaining columns. Call
.execute()to materialize.- Return type: