Skip to content

LazyGroupBy ​

Namespace: Polars.FSharp

A unified builder for Standard, Dynamic, and Rolling GroupBy operations. Holds the LazyFrame handle (ownership transferred to this builder) and grouping keys.

Constructors & Static Methods ​

new ​

fsharp
new(lfHandle: LazyFrameHandle, groupByType: GroupByType, keys: Expr[]) : LazyGroupBy

Parameters

NameTypeDescription
lfHandleLazyFrameHandle-
groupByTypeGroupByType-
keysExpr[]-

Instance Methods ​

Agg ​

Apply aggregations to the group. Routes the operation to the appropriate PolarsWrapper native call based on GroupByType.

fsharp
member Agg(aggs: seq<Expr>) : LazyFrame
member Agg([<ParamArray>] aggs: Expr[]) : LazyFrame

Parameters

NameTypeDescription
aggsseq<Expr> / Expr[]-

All ​

Aggregate all columns into lists.

fsharp
member All : unit -> LazyFrame

Count ​

Count the number of values in each group.

fsharp
member Count : unit -> LazyFrame

First ​

Aggregate the first values in the group.

fsharp
member First(?ignoreNulls: bool) : LazyFrame

Parameters

NameTypeDescription
ignoreNullsbool (optional)-

Having ​

Filter groups with a list of predicates after aggregation. Using this method is equivalent to adding the predicates to the aggregation and filtering afterwards.

fsharp
member Having(predicate: Expr) : LazyGroupBy

Parameters

NameTypeDescription
predicateExpr-

Get the first n rows of each group.

fsharp
member Head(?n: int) : LazyFrame

Parameters

NameTypeDescription
nint (optional)-

Last ​

Aggregate the last values in the group.

fsharp
member Last(?ignoreNulls: bool) : LazyFrame

Parameters

NameTypeDescription
ignoreNullsbool (optional)-

Len ​

Return the number of rows in each group.

fsharp
member Len(?name: string) : LazyFrame

Parameters

NameTypeDescription
namestring (optional)-

Max ​

Reduce the groups to the maximal value.

fsharp
member Max : unit -> LazyFrame

Mean ​

Reduce the groups to the mean value.

fsharp
member Mean : unit -> LazyFrame

Median ​

Reduce the groups to the median value.

fsharp
member Median : unit -> LazyFrame

Min ​

Reduce the groups to the minimal value.

fsharp
member Min : unit -> LazyFrame

NUnique ​

Count the unique values per group.

fsharp
member NUnique : unit -> LazyFrame

Quantile ​

Compute the quantile per group.

fsharp
member Quantile(quantile: float, ?interpolation: QuantileMethod) : LazyFrame

Parameters

NameTypeDescription
quantilefloat-
interpolationQuantileMethod (optional)-

Sum ​

Reduce the groups to the sum.

fsharp
member Sum : unit -> LazyFrame

Tail ​

Get the last n rows of each group.

fsharp
member Tail(?n: int) : LazyFrame

Parameters

NameTypeDescription
nint (optional)-

Released under the MIT License. Powered by the Polars Rust core & Apache Arrow.