Skip to content

Rows ​

Namespace: Polars.FSharp

Module Functions ​

Rows.choose ​

Chooses values from the rows of the enumerator that satisfy the predicate.

fsharp
Rows.choose : chooser: ('T -> 'U option) -> enumerator: RowEnumerator<'T> -> List<'U>

Parameters

NameTypeDescription
chooser('T -> 'U option)-
enumeratorRowEnumerator<'T>-

Rows.contains ​

Tests if the enumerator contains the specified element using default structural equality. Short-circuits upon discovery.

fsharp
Rows.contains : element: 'T -> enumerator: RowEnumerator<'T> -> bool

Parameters

NameTypeDescription
element'T-
enumeratorRowEnumerator<'T>-

Rows.countBy ​

Applies a key-generating function to each row and returns a dictionary with the frequency of each key.

fsharp
Rows.countBy : projection: ('T -> 'Key) -> enumerator: RowEnumerator<'T> -> Dictionary<'Key, int64>

Parameters

NameTypeDescription
projection('T -> 'Key)-
enumeratorRowEnumerator<'T>-

Rows.exists ​

Returns whether any row satisfies the predicate.

fsharp
Rows.exists : predicate: ('T -> bool) -> enumerator: RowEnumerator<'T> -> bool

Parameters

NameTypeDescription
predicate('T -> bool)-
enumeratorRowEnumerator<'T>-

Rows.filter ​

Filters the rows of the enumerator that satisfy the predicate.

fsharp
Rows.filter : predicate: ('T -> bool) -> enumerator: RowEnumerator<'T> -> List<'T>

Parameters

NameTypeDescription
predicate('T -> bool)-
enumeratorRowEnumerator<'T>-

Rows.fold ​

Folds over the rows of the enumerator, applying the folder function to each row.

fsharp
Rows.fold : folder: ('State -> ('T -> 'State)) -> initial: 'State -> enumerator: RowEnumerator<'T> -> 'State

Parameters

NameTypeDescription
folder('State -> ('T -> 'State))-
initial'State-
enumeratorRowEnumerator<'T>-

Rows.foldi ​

Folds over the rows of the enumerator with index.

fsharp
Rows.foldi : folder: (int64 -> ('State -> ('T -> 'State))) -> initial: 'State -> enumerator: RowEnumerator<'T> -> 'State

Parameters

NameTypeDescription
folder(int64 -> ('State -> ('T -> 'State)))-
initial'State-
enumeratorRowEnumerator<'T>-

Rows.forall ​

Returns whether all rows satisfy the predicate.

fsharp
Rows.forall : predicate: ('T -> bool) -> enumerator: RowEnumerator<'T> -> bool

Parameters

NameTypeDescription
predicate('T -> bool)-
enumeratorRowEnumerator<'T>-

Rows.groupBy ​

Groups the rows of the enumerator using the key-generating function, returning an idiomatic F# immutable Map of key to row list.

fsharp
Rows.groupBy : keySelector: ('T -> 'Key) -> enumerator: RowEnumerator<'T> -> Map<'Key, 'T list>

Parameters

NameTypeDescription
keySelector('T -> 'Key)-
enumeratorRowEnumerator<'T>-

Rows.head ​

Returns the first mapped row or raises InvalidOperationException if empty.

fsharp
Rows.head : enumerator: RowEnumerator<'T> -> 'T

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.iter ​

Iterates over the rows of the enumerator, applying the action to each row.

fsharp
Rows.iter : action: ('T -> unit) -> enumerator: RowEnumerator<'T> -> unit

Parameters

NameTypeDescription
action('T -> unit)-
enumeratorRowEnumerator<'T>-

Rows.iter2 ​

Iterates simultaneously over two equal-length RowEnumerators, applying the action pairwise.

fsharp
Rows.iter2 : action: ('T1 -> ('T2 -> unit)) -> enum1: RowEnumerator<'T1> -> enum2: RowEnumerator<'T2> -> unit

Parameters

NameTypeDescription
action('T1 -> ('T2 -> unit))-
enum1RowEnumerator<'T1>-
enum2RowEnumerator<'T2>-

Rows.iteri ​

Iterates over the rows of the enumerator, applying the action with zero-based 64-bit row index.

fsharp
Rows.iteri : action: (int64 -> ('T -> unit)) -> enumerator: RowEnumerator<'T> -> unit

Parameters

NameTypeDescription
action(int64 -> ('T -> unit))-
enumeratorRowEnumerator<'T>-

Rows.iteri2 ​

Iterates simultaneously over two equal-length RowEnumerators with zero-based 64-bit row index.

fsharp
Rows.iteri2 : action: (int64 -> ('T1 -> ('T2 -> unit))) -> enum1: RowEnumerator<'T1> -> enum2: RowEnumerator<'T2> -> unit

Parameters

NameTypeDescription
action(int64 -> ('T1 -> ('T2 -> unit)))-
enum1RowEnumerator<'T1>-
enum2RowEnumerator<'T2>-

Rows.last ​

Returns the last mapped row or raises InvalidOperationException if empty.

fsharp
Rows.last : enumerator: RowEnumerator<'T> -> 'T

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.length ​

Returns the total row count as a 64-bit integer.

fsharp
Rows.length : enumerator: RowEnumerator<'T> -> int64

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.map ​

Maps each row of the enumerator to a new value using the mapping function.

fsharp
Rows.map : mapping: ('T -> 'U) -> enumerator: RowEnumerator<'T> -> seq<'U>

Parameters

NameTypeDescription
mapping('T -> 'U)-
enumeratorRowEnumerator<'T>-

Rows.mapToArray ​

Projects all rows of the enumerator into a strongly-typed array using an inlined mapping function. Eliminates intermediate IEnumerator heap boxing and lambda allocations.

fsharp
Rows.mapToArray : mapping: ('TIn -> 'TOut) -> enumerator: RowEnumerator<'TIn> -> 'TOut[]

Parameters

NameTypeDescription
mapping('TIn -> 'TOut)-
enumeratorRowEnumerator<'TIn>-

Rows.mapi ​

Maps each row with its zero-based 64-bit row index to a lazy F# sequence.

fsharp
Rows.mapi : mapping: (int64 -> ('T -> 'U)) -> enumerator: RowEnumerator<'T> -> seq<'U>

Parameters

NameTypeDescription
mapping(int64 -> ('T -> 'U))-
enumeratorRowEnumerator<'T>-

Rows.reduce ​

Applies a function to each row, threading an accumulator argument through the computation. Raises InvalidOperationException if the enumerator has no elements.

fsharp
Rows.reduce : reduction: ('T -> ('T -> 'T)) -> enumerator: RowEnumerator<'T> -> 'T

Parameters

NameTypeDescription
reduction('T -> ('T -> 'T))-
enumeratorRowEnumerator<'T>-

Rows.scan ​

Like fold, but returns a lazy sequence of intermediate and final results.

fsharp
Rows.scan : folder: ('State -> ('T -> 'State)) -> initial: 'State -> enumerator: RowEnumerator<'T> -> seq<'State>

Parameters

NameTypeDescription
folder('State -> ('T -> 'State))-
initial'State-
enumeratorRowEnumerator<'T>-

Rows.sumBy ​

Sums the values of the rows of the enumerator using the projection function.

fsharp
Rows.sumBy : projection: ('T -> 'Num) -> enumerator: RowEnumerator<'T> -> 'Num

Parameters

NameTypeDescription
projection('T -> 'Num)-
enumeratorRowEnumerator<'T>-

Rows.sumBy$W ​

fsharp
Rows.sumBy$W : get_Zero: (unit -> 'Num) -> op_Addition: ('Num -> ('Num -> 'Num)) -> projection: ('T -> 'Num) -> enumerator: RowEnumerator<'T> -> 'Num

Parameters

NameTypeDescription
get_Zero(unit -> 'Num)-
op_Addition('Num -> ('Num -> 'Num))-
projection('T -> 'Num)-
enumeratorRowEnumerator<'T>-

Rows.toArray ​

Materializes all or remaining mapped rows into an array.

fsharp
Rows.toArray : enumerator: RowEnumerator<'T> -> 'T[]

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.toList ​

Materializes all or remaining mapped rows into an F# immutable list.

fsharp
Rows.toList : enumerator: RowEnumerator<'T> -> 'T list

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.toResizeArray ​

Materializes all or remaining mapped rows into a ResizeArray.

fsharp
Rows.toResizeArray : enumerator: RowEnumerator<'T> -> List<'T>

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.tryFind ​

Tries to find a row that satisfies the predicate.

fsharp
Rows.tryFind : predicate: ('T -> bool) -> enumerator: RowEnumerator<'T> -> 'T option

Parameters

NameTypeDescription
predicate('T -> bool)-
enumeratorRowEnumerator<'T>-

Rows.tryFindValue ​

Tries to find the first row that satisfies the predicate, returning a ValueOption to eliminate heap boxing.

fsharp
Rows.tryFindValue : predicate: ('T -> bool) -> enumerator: RowEnumerator<'T> -> 'T voption

Parameters

NameTypeDescription
predicate('T -> bool)-
enumeratorRowEnumerator<'T>-

Rows.tryHead ​

Returns the first mapped row as an option.

fsharp
Rows.tryHead : enumerator: RowEnumerator<'T> -> 'T option

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.tryHeadValue ​

Returns the first mapped row as a ValueOption.

fsharp
Rows.tryHeadValue : enumerator: RowEnumerator<'T> -> 'T voption

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.tryLast ​

Returns the last mapped row as an option.

fsharp
Rows.tryLast : enumerator: RowEnumerator<'T> -> 'T option

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.tryLastValue ​

Returns the last mapped row as a ValueOption.

fsharp
Rows.tryLastValue : enumerator: RowEnumerator<'T> -> 'T voption

Parameters

NameTypeDescription
enumeratorRowEnumerator<'T>-

Rows.tryPick ​

Applies the given function to successive elements, returning the first result where the function returns Some. Short-circuits immediately.

fsharp
Rows.tryPick : chooser: ('T -> 'U option) -> enumerator: RowEnumerator<'T> -> 'U option

Parameters

NameTypeDescription
chooser('T -> 'U option)-
enumeratorRowEnumerator<'T>-

Rows.tryPickValue ​

Applies the given function to successive elements, returning the first result where the function returns ValueSome. Short-circuits with zero heap allocation.

fsharp
Rows.tryPickValue : chooser: ('T -> 'U voption) -> enumerator: RowEnumerator<'T> -> 'U voption

Parameters

NameTypeDescription
chooser('T -> 'U voption)-
enumeratorRowEnumerator<'T>-

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