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
new(lfHandle: LazyFrameHandle, groupByType: GroupByType, keys: Expr[]) : LazyGroupByParameters
| Name | Type | Description |
|---|---|---|
lfHandle | LazyFrameHandle | - |
groupByType | GroupByType | - |
keys | Expr[] | - |
Instance Methods
Agg
Apply aggregations to the group. Routes the operation to the appropriate PolarsWrapper native call based on GroupByType.
member Agg(aggs: seq<Expr>) : LazyFrame
member Agg([<ParamArray>] aggs: Expr[]) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
aggs | seq<Expr> / Expr[] | - |
All
Aggregate all columns into lists.
member All : unit -> LazyFrameCount
Count the number of values in each group.
member Count : unit -> LazyFrameFirst
Aggregate the first values in the group.
member First(?ignoreNulls: bool) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
ignoreNulls | bool (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.
member Having(predicate: Expr) : LazyGroupByParameters
| Name | Type | Description |
|---|---|---|
predicate | Expr | - |
Head
Get the first n rows of each group.
member Head(?n: int) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
n | int (optional) | - |
Last
Aggregate the last values in the group.
member Last(?ignoreNulls: bool) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
ignoreNulls | bool (optional) | - |
Len
Return the number of rows in each group.
member Len(?name: string) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
name | string (optional) | - |
Max
Reduce the groups to the maximal value.
member Max : unit -> LazyFrameMean
Reduce the groups to the mean value.
member Mean : unit -> LazyFrameMedian
Reduce the groups to the median value.
member Median : unit -> LazyFrameMin
Reduce the groups to the minimal value.
member Min : unit -> LazyFrameNUnique
Count the unique values per group.
member NUnique : unit -> LazyFrameQuantile
Compute the quantile per group.
member Quantile(quantile: float, ?interpolation: QuantileMethod) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
quantile | float | - |
interpolation | QuantileMethod (optional) | - |
Sum
Reduce the groups to the sum.
member Sum : unit -> LazyFrameTail
Get the last n rows of each group.
member Tail(?n: int) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
n | int (optional) | - |