polars.internals.lazy_frame.LazyGroupBy.agg

LazyGroupBy.agg(aggs: Union[List[polars.internals.expr.Expr], polars.internals.expr.Expr]) polars.internals.lazy_frame.LDF

Describe the aggregation that need to be done on a group.

Parameters
aggs

Single/ Multiple aggregation expression(s).

Examples

>>> (
...     pl.scan_csv("data.csv")
...     .groupby("groups")
...     .agg(
...         [
...             pl.col("name").n_unique().alias("unique_names"),
...             pl.max("values"),
...         ]
...     )
... )