GroupBy
Namespace: Polars.FSharp
Intermediate builder for eager GroupBy operations. Under the hood, this routes through the Lazy engine to maximize performance.
Constructors & Static Methods
new
new(df: DataFrame, groupByType: GroupByType, keys: Expr[]) : GroupByParameters
| Name | Type | Description |
|---|---|---|
df | DataFrame | - |
groupByType | GroupByType | - |
keys | Expr[] | - |
Instance Methods
Agg
Aggregate columns using the provided expressions.
member Agg(aggs: seq<Expr>) : DataFrame
member Agg([<ParamArray>] aggs: Expr[]) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
aggs | seq<Expr> / Expr[] | - |
All
Get all columns as lists.
member All : unit -> DataFrameCount
Count the number of rows in each group.
member Count : unit -> DataFrameFirst
Get the first value in each group.
member First(?ignoreNulls: bool) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
ignoreNulls | bool (optional) | - |
Having
Filter groups with a predicate after aggregation.
member Having(predicate: Expr) : GroupByParameters
| Name | Type | Description |
|---|---|---|
predicate | Expr | - |
Head
Get the first n rows of each group.
member Head(?n: int) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
n | int (optional) | - |
Last
Get the last value in each group.
member Last(?ignoreNulls: bool) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
ignoreNulls | bool (optional) | - |
Len
Get the length of each group.
member Len(?name: string) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
name | string (optional) | - |
Max
Get the maximum value in each group.
member Max : unit -> DataFrameMean
Get the mean value in each group.
member Mean : unit -> DataFrameMedian
Get the median value in each group.
member Median : unit -> DataFrameMin
Get the minimum value in each group.
member Min : unit -> DataFrameNUnique
Count the number of unique values in each group.
member NUnique : unit -> DataFrameQuantile
Get the quantile value in each group.
member Quantile(quantile: float, ?interpolation: QuantileMethod) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
quantile | float | - |
interpolation | QuantileMethod (optional) | - |
Sum
Get the sum of values in each group.
member Sum : unit -> DataFrameTail
Get the last n rows of each group.
member Tail(?n: int) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
n | int (optional) | - |