Skip to content

Operations on Polars grouped LazyFrame

Description

This class comes from \<LazyFrame>$group_by(), etc.

Active bindings

columns

$columns returns a character vector with the column names.

Examples

library("polars")

as_polars_lf(mtcars)$group_by("cyl")$agg(
  pl$col("mpg")$sum()
)
#> polars LazyFrame
#>  $explain(): Show the optimized query plan.
#> 
#> Naive plan:
#> AGGREGATE
#>  [col("mpg").sum()] BY [col("cyl")] FROM
#>   DF ["mpg", "cyl", "disp", "hp"]; PROJECT */11 COLUMNS; SELECTION: None