Expr.Array (ArrayOps)
Namespace: Polars.FSharp
Instance Methods
Agg
member Agg(element: Expr) : ExprParameters
| Name | Type | Description |
|---|---|---|
element | Expr | - |
All
Check if all values in the array are true.
member All(?ignoreNulls: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
ignoreNulls | bool (optional) | - |
Any
Check if any value in the array is true.
member Any(?ignoreNulls: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
ignoreNulls | bool (optional) | - |
ArgMax
Get the index of the maximum value.
member ArgMax : unit -> ExprArgMin
Get the index of the minimum value.
member ArgMin : unit -> ExprConcat
Combine the current expression with other expressions into an Array. Result: [parent_val, other_val_1, other_val_2, ...] Equivalent to: pl.concatArray([parent, others...])
member Concat(others: seq<'a>) : ExprParameters
| Name | Type | Description |
|---|---|---|
others | seq<'a> | - |
Contains
Check if the array contains a specific item.
Check if the array contains a literal value.
member Contains(item: Expr, ?nullsEqual: bool) : Expr
member Contains(item: string, ?nullsEqual: bool) : Expr
member Contains(item: int, ?nullsEqual: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
item | Expr / string / int | - |
nullsEqual | bool (optional) | - |
CountMatches
Count how often the value produced by element occurs.
member CountMatches(element: Expr) : ExprParameters
| Name | Type | Description |
|---|---|---|
element | Expr | An expression that produces a single value |
Eval
Run any polars expression against the arrays’ elements.
member Eval(expr: Expr, ?asList: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
expr | Expr | Expression to run. Note that you can select an element with pl.element() |
asList | bool (optional) | Collect the resulting data as a list. This allows for expressions which output a variable amount of data. |
Explode
Explode the array to rows.
member Explode(?emptyAsNull: bool, ?keepNulls: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
emptyAsNull | bool (optional) | - |
keepNulls | bool (optional) | - |
First
Get the first value of the sub-arrays.
member First : unit -> ExprGet
Get value at integer index.
member Get(index: int, ?nullOnOob: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
index | int | - |
nullOnOob | bool (optional) | - |
Join
Join array elements into a string.
member Join(separator: string, ?ignoreNulls: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
separator | string | - |
ignoreNulls | bool (optional) | - |
Last
Get the last value of the sub-arrays.
member Last : unit -> ExprLen
Get the length of the array
member Len : unit -> ExprMax
Compute the maximum value in the array.
member Max : unit -> ExprMean
Compute the mean value in the array.
member Mean : unit -> ExprMedian
Compute the median value in the array.
member Median : unit -> ExprMin
Compute the minimum value in the array.
member Min : unit -> ExprNUnique
Count the number of unique values in every sub-arrays.
member NUnique : unit -> ExprReverse
Reverse the array.
member Reverse : unit -> ExprSort
Sort the array.
member Sort(?descending: bool, ?nullsLast: bool, ?maintainOrder: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
descending | bool (optional) | - |
nullsLast | bool (optional) | - |
maintainOrder | bool (optional) | - |
Std
Compute the standard deviation of the values in the array.
member Std(?ddof: int) : ExprParameters
| Name | Type | Description |
|---|---|---|
ddof | int (optional) | - |
Sum
Compute the sum of the values in the array.
member Sum : unit -> ExprToList
Convert Array to List (variable length).
member ToList : unit -> ExprToStruct
Convert Array to Struct.
member ToStruct([<ParamArray>] names: string[]) : ExprParameters
| Name | Type | Description |
|---|---|---|
names | string[] | - |
Unique
Get unique values in the array.
member Unique(?maintainOrder: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
maintainOrder | bool (optional) | - |
Var
Compute the variance of the values in the array.
member Var(?ddof: int) : ExprParameters
| Name | Type | Description |
|---|---|---|
ddof | int (optional) | - |