Skip to content

Expr.Array (ArrayOps) ​

Namespace: Polars.FSharp

Instance Methods ​

Agg ​

fsharp
member Agg(element: Expr) : Expr

Parameters

NameTypeDescription
elementExpr-

All ​

Check if all values in the array are true.

fsharp
member All(?ignoreNulls: bool) : Expr

Parameters

NameTypeDescription
ignoreNullsbool (optional)-

Any ​

Check if any value in the array is true.

fsharp
member Any(?ignoreNulls: bool) : Expr

Parameters

NameTypeDescription
ignoreNullsbool (optional)-

ArgMax ​

Get the index of the maximum value.

fsharp
member ArgMax : unit -> Expr

ArgMin ​

Get the index of the minimum value.

fsharp
member ArgMin : unit -> Expr

Concat ​

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...])

fsharp
member Concat(others: seq<'a>) : Expr

Parameters

NameTypeDescription
othersseq<'a>-

Contains ​

Check if the array contains a specific item.

Check if the array contains a literal value.

fsharp
member Contains(item: Expr, ?nullsEqual: bool) : Expr
member Contains(item: string, ?nullsEqual: bool) : Expr
member Contains(item: int, ?nullsEqual: bool) : Expr

Parameters

NameTypeDescription
itemExpr / string / int-
nullsEqualbool (optional)-

CountMatches ​

Count how often the value produced by element occurs.

fsharp
member CountMatches(element: Expr) : Expr

Parameters

NameTypeDescription
elementExprAn expression that produces a single value

Eval ​

Run any polars expression against the arrays’ elements.

fsharp
member Eval(expr: Expr, ?asList: bool) : Expr

Parameters

NameTypeDescription
exprExprExpression to run. Note that you can select an element with pl.element()
asListbool (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.

fsharp
member Explode(?emptyAsNull: bool, ?keepNulls: bool) : Expr

Parameters

NameTypeDescription
emptyAsNullbool (optional)-
keepNullsbool (optional)-

First ​

Get the first value of the sub-arrays.

fsharp
member First : unit -> Expr

Get ​

Get value at integer index.

fsharp
member Get(index: int, ?nullOnOob: bool) : Expr

Parameters

NameTypeDescription
indexint-
nullOnOobbool (optional)-

Join ​

Join array elements into a string.

fsharp
member Join(separator: string, ?ignoreNulls: bool) : Expr

Parameters

NameTypeDescription
separatorstring-
ignoreNullsbool (optional)-

Last ​

Get the last value of the sub-arrays.

fsharp
member Last : unit -> Expr

Len ​

Get the length of the array

fsharp
member Len : unit -> Expr

Max ​

Compute the maximum value in the array.

fsharp
member Max : unit -> Expr

Mean ​

Compute the mean value in the array.

fsharp
member Mean : unit -> Expr

Median ​

Compute the median value in the array.

fsharp
member Median : unit -> Expr

Min ​

Compute the minimum value in the array.

fsharp
member Min : unit -> Expr

NUnique ​

Count the number of unique values in every sub-arrays.

fsharp
member NUnique : unit -> Expr

Reverse ​

Reverse the array.

fsharp
member Reverse : unit -> Expr

Sort ​

Sort the array.

fsharp
member Sort(?descending: bool, ?nullsLast: bool, ?maintainOrder: bool) : Expr

Parameters

NameTypeDescription
descendingbool (optional)-
nullsLastbool (optional)-
maintainOrderbool (optional)-

Std ​

Compute the standard deviation of the values in the array.

fsharp
member Std(?ddof: int) : Expr

Parameters

NameTypeDescription
ddofint (optional)-

Sum ​

Compute the sum of the values in the array.

fsharp
member Sum : unit -> Expr

ToList ​

Convert Array to List (variable length).

fsharp
member ToList : unit -> Expr

ToStruct ​

Convert Array to Struct.

fsharp
member ToStruct([<ParamArray>] names: string[]) : Expr

Parameters

NameTypeDescription
namesstring[]-

Unique ​

Get unique values in the array.

fsharp
member Unique(?maintainOrder: bool) : Expr

Parameters

NameTypeDescription
maintainOrderbool (optional)-

Var ​

Compute the variance of the values in the array.

fsharp
member Var(?ddof: int) : Expr

Parameters

NameTypeDescription
ddofint (optional)-

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