Skip to content

DataFrame ​

Namespace: Polars.FSharp

An eager DataFrame holding data in memory.

DataFrames are 2D tabular data structures with named columns of potentially different types.

Properties & Indexers ​

PropertyTypeDescription
ColumnNamesstring[]-
Columnsstring[]-
DataTypesDataType list-
Heightint64-
IsEmptyboolTrue if the DataFrame contains no rows.
IsVoidbool-
SchemaPolarsSchemaGet the schema
Shape(int64 * int64)Returns the shape of the DataFrame as (Height, Width).
Widthint64-

Constructors & Static Methods ​

ConcatDiagonal ​

Diagonal concatenation.

fsharp
static member ConcatDiagonal(dfs: seq<DataFrame>) : DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-

ConcatHorizontal ​

Horizontal concatenation (Index alignment).

fsharp
static member ConcatHorizontal(
    dfs: seq<DataFrame>,
    ?checkDuplicates: bool,
    ?strict: bool,
    ?unitLengthAsScalar: bool
) : DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-
checkDuplicatesbool (optional)-
strictbool (optional)For Horizontal: if true, error on height mismatch.
unitLengthAsScalarbool (optional)For Horizontal: if true, broadcast length-1 DataFrames to match height.

ConcatVertical ​

Vertical concatenation (Column alignment).

fsharp
static member ConcatVertical(dfs: seq<DataFrame>) : DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-

FromArrow ​

Create a DataFrame directly from an Apache Arrow RecordBatch.

fsharp
static member FromArrow(batch: RecordBatch) : DataFrame

Parameters

NameTypeDescription
batchRecordBatch-

FromArrowStream ​

fsharp
static member FromArrowStream(stream: IArrowArrayStream) : DataFrame

Parameters

NameTypeDescription
streamIArrowArrayStream-

JsonNormalize ​

Normalize a single JSON object (represented as a Map) into a DataFrame.

Normalize a sequence of JSON objects into a DataFrame.

fsharp
static member JsonNormalize(
    data: Map<string, obj>,
    ?separator: string,
    ?maxLevel: int,
    ?schema: PolarsSchema,
    ?strict: bool,
    ?inferSchemaLength: uint32,
    ?encoder: (obj -> string)
) : DataFrame

static member JsonNormalize(
    data: seq<Map<string, obj>>,
    ?separator: string,
    ?maxLevel: int,
    ?schema: PolarsSchema,
    ?strict: bool,
    ?inferSchemaLength: uint32,
    ?encoder: (obj -> string)
) : DataFrame

Parameters

NameTypeDescription
dataMap<string, obj> / seq<Map<string, obj>>A single JSON object.
separatorstring (optional)Separator for nested fields.
maxLevelint (optional)Max nesting level.
schemaPolarsSchema (optional)Optional schema for the output.
strictbool (optional)Strict mode for type inference.
inferSchemaLengthuint32 (optional)Rows used for schema inference.
encoder(obj -> string) (optional)Custom value-to-string encoder.

JsonNormalizeFromString ​

Normalize a JSON string representing a single object or an array of objects.

fsharp
static member JsonNormalizeFromString(
    jsonString: string,
    ?separator: string,
    ?maxLevel: int,
    ?schema: PolarsSchema,
    ?strict: bool,
    ?inferSchemaLength: uint32,
    ?encoder: (obj -> string)
) : DataFrame

Parameters

NameTypeDescription
jsonStringstringA valid JSON string.
separatorstring (optional)Separator for nested fields.
maxLevelint (optional)Max nesting level.
schemaPolarsSchema (optional)Optional schema for the output.
strictbool (optional)Strict mode for type inference.
inferSchemaLengthuint32 (optional)Rows used for schema inference.
encoder(obj -> string) (optional)Custom value-to-string encoder.

ReadAdbc ​

Generate DataFrame from ADBC query results

Executes a SQL query directly against an ADBC connection and reads the result into a zero-copy Polars DataFrame. Pure syntactic sugar: automatically manages the creation and disposal of the underlying AdbcStatement.

fsharp
static member ReadAdbc(statement: AdbcStatement) : DataFrame
static member ReadAdbc(connection: AdbcConnection, sqlQuery: string) : DataFrame

Parameters

NameTypeDescription
statementAdbcStatement-
connectionAdbcConnectionThe active ADBC connection (e.g., DuckDB, SQLite).
sqlQuerystringThe SQL query string to execute.

ReadAvro ​

Read an Avro file into a DataFrame.

Read an Avro memory buffer into a DataFrame.

Read an Avro memory Stream into a DataFrame.

fsharp
static member ReadAvro(
    path: string,
    ?nRows: uint64,
    ?columns: seq<string>,
    ?projection: seq<int>
) : DataFrame

static member ReadAvro(
    buffer: byte[],
    ?nRows: uint64,
    ?columns: seq<string>,
    ?projection: seq<int>
) : DataFrame

static member ReadAvro(
    stream: Stream,
    ?nRows: uint64,
    ?columns: seq<string>,
    ?projection: seq<int>
) : DataFrame

Parameters

NameTypeDescription
pathstringThe path to the Avro file.
nRowsuint64 (optional)Stop reading when nRows are read.
columnsseq<string> (optional)Columns to select/project by name.
projectionseq<int> (optional)Columns to select/project by index.
bufferbyte[]The byte array containing Avro data.
streamStreamThe stream containing Avro data.

Returns: A new DataFrame.


ReadCsv ​

Read a DataFrame from a CSV file.

Note: This method internally uses LazyFrame.ScanCsv and collects the result. For larger-than-memory datasets or better query optimization, consider using LazyFrame.ScanCsv directly.

Read a DataFrame from a CSV memory buffer.

Read a DataFrame from a CSV memory stream.

fsharp
static member ReadCsv(
    path: string,
    ?columns: seq<string>,
    ?hasHeader: bool,
    ?separator: char,
    ?quoteChar: char,
    ?eolChar: char,
    ?ignoreErrors: bool,
    ?tryParseDates: bool,
    ?lowMemory: bool,
    ?skipRows: uint64,
    ?nRows: uint64,
    ?inferSchemaLength: uint64,
    ?inferSchemaFiles: uint64,
    ?schema: PolarsSchema,
    ?dtypeOverride: PolarsSchema,
    ?encoding: CsvEncoding,
    ?nullValues: seq<string>,
    ?missingIsNull: bool,
    ?commentPrefix: string,
    ?decimalComma: bool,
    ?truncateRaggedLines: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint64,
    ?cloudOptions: CloudOptions
) : DataFrame

static member ReadCsv(
    buffer: byte[],
    ?columns: seq<string>,
    ?hasHeader: bool,
    ?separator: char,
    ?quoteChar: char,
    ?eolChar: char,
    ?ignoreErrors: bool,
    ?tryParseDates: bool,
    ?lowMemory: bool,
    ?skipRows: uint64,
    ?nRows: uint64,
    ?inferSchemaLength: uint64,
    ?inferSchemaFiles: uint64,
    ?schema: PolarsSchema,
    ?dtypeOverride: PolarsSchema,
    ?encoding: CsvEncoding,
    ?nullValues: seq<string>,
    ?missingIsNull: bool,
    ?commentPrefix: string,
    ?decimalComma: bool,
    ?truncateRaggedLines: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint64
) : DataFrame

static member ReadCsv(
    stream: Stream,
    ?columns: seq<string>,
    ?hasHeader: bool,
    ?separator: char,
    ?quoteChar: char,
    ?eolChar: char,
    ?ignoreErrors: bool,
    ?tryParseDates: bool,
    ?lowMemory: bool,
    ?skipRows: uint64,
    ?nRows: uint64,
    ?inferSchemaLength: uint64,
    ?inferSchemaFiles: uint64,
    ?schema: PolarsSchema,
    ?encoding: CsvEncoding,
    ?nullValues: seq<string>,
    ?missingIsNull: bool,
    ?commentPrefix: string,
    ?decimalComma: bool,
    ?truncateRaggedLines: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint64
) : DataFrame

Parameters

NameTypeDescription
pathstring-
columnsseq<string> (optional)-
hasHeaderbool (optional)-
separatorchar (optional)-
quoteCharchar (optional)-
eolCharchar (optional)-
ignoreErrorsbool (optional)-
tryParseDatesbool (optional)-
lowMemorybool (optional)-
skipRowsuint64 (optional)-
nRowsuint64 (optional)-
inferSchemaLengthuint64 (optional)-
inferSchemaFilesuint64 (optional)-
schemaPolarsSchema (optional)-
dtypeOverridePolarsSchema (optional)-
encodingCsvEncoding (optional)-
nullValuesseq<string> (optional)-
missingIsNullbool (optional)-
commentPrefixstring (optional)-
decimalCommabool (optional)-
truncateRaggedLinesbool (optional)-
rowIndexNamestring (optional)-
rowIndexOffsetuint64 (optional)-
cloudOptionsCloudOptions (optional)-
bufferbyte[]-
streamStream-

ReadCsvAsync ​

Read a CSV file asynchronously into a DataFrame.

fsharp
static member ReadCsvAsync(
    path: string,
    ?columns: seq<string>,
    ?hasHeader: bool,
    ?separator: char,
    ?quoteChar: char,
    ?eolChar: char,
    ?ignoreErrors: bool,
    ?tryParseDates: bool,
    ?lowMemory: bool,
    ?skipRows: uint64,
    ?nRows: uint64,
    ?inferSchemaLength: uint64,
    ?inferSchemaFiles: uint64,
    ?schema: PolarsSchema,
    ?encoding: CsvEncoding,
    ?nullValues: seq<string>,
    ?missingIsNull: bool,
    ?commentPrefix: string,
    ?decimalComma: bool,
    ?truncateRaggedLines: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint64,
    ?cloudOptions: CloudOptions
) : Task<DataFrame>

Parameters

NameTypeDescription
pathstring-
columnsseq<string> (optional)-
hasHeaderbool (optional)-
separatorchar (optional)-
quoteCharchar (optional)-
eolCharchar (optional)-
ignoreErrorsbool (optional)-
tryParseDatesbool (optional)-
lowMemorybool (optional)-
skipRowsuint64 (optional)-
nRowsuint64 (optional)-
inferSchemaLengthuint64 (optional)-
inferSchemaFilesuint64 (optional)-
schemaPolarsSchema (optional)-
encodingCsvEncoding (optional)-
nullValuesseq<string> (optional)-
missingIsNullbool (optional)-
commentPrefixstring (optional)-
decimalCommabool (optional)-
truncateRaggedLinesbool (optional)-
rowIndexNamestring (optional)-
rowIndexOffsetuint64 (optional)-
cloudOptionsCloudOptions (optional)-

ReadDb ​

[Eager] Create a DataFrame from an IDataReader (e.g. SqlDataReader).

Uses high-performance streaming ingestion via Apache Arrow.

fsharp
static member ReadDb(reader: IDataReader, ?batchSize: int) : DataFrame

Parameters

NameTypeDescription
readerIDataReaderThe open IDataReader instance.
batchSizeint (optional)Number of rows per Arrow batch (default 50,000).

ReadDelta ​

Create a DataFrame by reading a Delta Lake table.

fsharp
static member ReadDelta(
    path: string,
    ?version: uint64,
    ?datetime: string,
    ?nRows: uint64,
    ?parallelStrategy: ParallelStrategy,
    ?lowMemory: bool,
    ?useStatistics: bool,
    ?glob: bool,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstringPath to the Delta Lake table (folder containing _delta_log).
versionuint64 (optional)The version of the table to read (e.g., 0L, 1L). Mutually exclusive with datetime.
datetimestring (optional)The timestamp to read (ISO-8601 string, e.g., "2026-02-09T12:00:00Z"). Mutually exclusive with version.
nRowsuint64 (optional)-
parallelStrategyParallelStrategy (optional)-
lowMemorybool (optional)-
useStatisticsbool (optional)-
globbool (optional)-
rechunkbool (optional)-
cachebool (optional)-
rowIndexNamestring (optional)-
rowIndexOffsetuint32 (optional)-
includePathColumnstring (optional)-
schemaPolarsSchema (optional)-
hivePartitioningbool (optional)-
hivePartitionSchemaPolarsSchema (optional)-
tryParseHiveDatesbool (optional)-
cloudOptionsCloudOptions (optional)-

Returns: A new LazyFrame.


ReadExcel ​

Read an Excel file (.xlsx) into a DataFrame using the high-performance Rust 'calamine' engine.

fsharp
static member ReadExcel(
    path: string,
    ?sheetName: string,
    ?sheetIndex: uint64,
    ?schema: PolarsSchema,
    ?hasHeader: bool,
    ?inferSchemaLen: uint64,
    ?dropEmptyRows: bool,
    ?raiseIfEmpty: bool
) : DataFrame

Parameters

NameTypeDescription
pathstringPath to the .xlsx file.
sheetNamestring (optional)Name of the sheet to read. If specified, takes precedence over sheetIndex.
sheetIndexuint64 (optional)Index of the sheet to read (0-based). Default is 0.
schemaPolarsSchema (optional)Optional schema overrides to enforce specific column types.
hasHeaderbool (optional)Indicates if the first row contains header names. Default is true.
inferSchemaLenuint64 (optional)Number of rows to use for schema inference. Default is 100.
dropEmptyRowsbool (optional)If true, drop rows where all cells are empty/null. Default is true.
raiseIfEmptybool (optional)If true, raises an error if the sheet is empty. Default is true.

ReadIpc ​

Read an Arrow IPC (Feather v2) file into a DataFrame.

Note: This method internally uses LazyFrame.ScanIpc and collects the result.

Read IPC from in-memory bytes.

Read IPC from a Stream.

fsharp
static member ReadIpc(
    path: string,
    ?columns: seq<string>,
    ?nRows: uint64,
    ?rechunk: bool,
    ?cache: bool,
    ?glob: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

static member ReadIpc(
    buffer: byte[],
    ?columns: seq<string>,
    ?nRows: uint64,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool
) : DataFrame

static member ReadIpc(
    stream: Stream,
    ?columns: seq<string>,
    ?nRows: uint64,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool
) : DataFrame

Parameters

NameTypeDescription
pathstring-
columnsseq<string> (optional)-
nRowsuint64 (optional)-
rechunkbool (optional)-
cachebool (optional)-
globbool (optional)-
rowIndexNamestring (optional)-
rowIndexOffsetuint32 (optional)-
includePathColumnstring (optional)-
schemaPolarsSchema (optional)-
hivePartitioningbool (optional)-
hivePartitionSchemaPolarsSchema (optional)-
tryParseHiveDatesbool (optional)-
cloudOptionsCloudOptions (optional)-
bufferbyte[]-
streamStream-

ReadIpcStream ​

Read into a DataFrame from Arrow IPC record batch stream.

fsharp
static member ReadIpcStream(
    path: string,
    ?columns: seq<string>,
    ?projection: seq<uint32>,
    ?nRows: uint64,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?rechunk: bool
) : DataFrame

static member ReadIpcStream(
    buffer: ReadOnlySpan<byte>,
    ?columns: seq<string>,
    ?projection: seq<uint32>,
    ?nRows: uint64,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?rechunk: bool
) : DataFrame

Parameters

NameTypeDescription
pathstringPath to the IPC stream file or a byte buffer
columnsseq<string> (optional)Columns to select.
projectionseq<uint32> (optional)Column indices to select.
nRowsuint64 (optional)Stop reading from IPC stream after reading n rows
rowIndexNamestring (optional)Insert a row index column with the given name into the DataFrame as the first column. If set to None (default), no row index column is created.
rowIndexOffsetuint32 (optional)Start the row index at this offset.Only used if row_index_name is set.
rechunkbool (optional)Make sure that all data is contiguous.
bufferReadOnlySpan<byte>-

ReadIpcStreamSchema ​

Get the schema of an IPC file without reading data.

fsharp
static member ReadIpcStreamSchema(path: string) : PolarsSchema
static member ReadIpcStreamSchema(buffer: ReadOnlySpan<byte>) : PolarsSchema

Parameters

NameTypeDescription
pathstring-
bufferReadOnlySpan<byte>-

ReadJson ​

Read a JSON file into a DataFrame.

Read JSON from in-memory bytes.

Read JSON from a Stream.

fsharp
static member ReadJson(
    path: string,
    ?columns: seq<string>,
    ?schema: PolarsSchema,
    ?inferSchemaLen: uint64,
    ?batchSize: uint64,
    ?ignoreErrors: bool,
    ?jsonFormat: JsonFormat
) : DataFrame

static member ReadJson(
    buffer: byte[],
    ?columns: seq<string>,
    ?schema: PolarsSchema,
    ?inferSchemaLen: uint64,
    ?batchSize: uint64,
    ?ignoreErrors: bool,
    ?jsonFormat: JsonFormat
) : DataFrame

static member ReadJson(
    stream: Stream,
    ?columns: seq<string>,
    ?schema: PolarsSchema,
    ?inferSchemaLen: uint64,
    ?batchSize: uint64,
    ?ignoreErrors: bool,
    ?jsonFormat: JsonFormat
) : DataFrame

Parameters

NameTypeDescription
pathstring-
columnsseq<string> (optional)-
schemaPolarsSchema (optional)-
inferSchemaLenuint64 (optional)-
batchSizeuint64 (optional)-
ignoreErrorsbool (optional)-
jsonFormatJsonFormat (optional)-
bufferbyte[]-
streamStream-

ReadParquet ​

Read a parquet file into a DataFrame (Eager).

Note: This method internally uses LazyFrame.ScanParquet and collects the result.

Read Parquet from an in-memory byte array.

Read Parquet from a Stream.

fsharp
static member ReadParquet(
    path: string,
    ?columns: seq<string>,
    ?nRows: uint64,
    ?parallelStrategy: ParallelStrategy,
    ?lowMemory: bool,
    ?useStatistics: bool,
    ?glob: bool,
    ?allowMissingColumns: bool,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

static member ReadParquet(
    buffer: byte[],
    ?columns: seq<string>,
    ?nRows: uint64,
    ?parallelStrategy: ParallelStrategy,
    ?lowMemory: bool,
    ?useStatistics: bool,
    ?allowMissingColumns: bool,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool
) : DataFrame

static member ReadParquet(
    stream: Stream,
    ?columns: seq<string>,
    ?nRows: uint64,
    ?parallelStrategy: ParallelStrategy,
    ?lowMemory: bool,
    ?useStatistics: bool,
    ?allowMissingColumns: bool,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool
) : DataFrame

Parameters

NameTypeDescription
pathstring-
columnsseq<string> (optional)-
nRowsuint64 (optional)-
parallelStrategyParallelStrategy (optional)-
lowMemorybool (optional)-
useStatisticsbool (optional)-
globbool (optional)-
allowMissingColumnsbool (optional)-
rechunkbool (optional)-
cachebool (optional)-
rowIndexNamestring (optional)-
rowIndexOffsetuint32 (optional)-
includePathColumnstring (optional)-
schemaPolarsSchema (optional)-
hivePartitioningbool (optional)-
hivePartitionSchemaPolarsSchema (optional)-
tryParseHiveDatesbool (optional)-
cloudOptionsCloudOptions (optional)-
bufferbyte[]-
streamStream-

ReadParquetAsync ​

Asynchronously read a Parquet file.

fsharp
static member ReadParquetAsync(
    path: string,
    ?columns: seq<string>,
    ?nRows: uint64,
    ?parallelStrategy: ParallelStrategy,
    ?lowMemory: bool,
    ?useStatistics: bool,
    ?glob: bool,
    ?allowMissingColumns: bool,
    ?rechunk: bool,
    ?cache: bool,
    ?rowIndexName: string,
    ?rowIndexOffset: uint32,
    ?includePathColumn: string,
    ?schema: PolarsSchema,
    ?hivePartitioning: bool,
    ?hivePartitionSchema: PolarsSchema,
    ?tryParseHiveDates: bool,
    ?cloudOptions: CloudOptions
) : Task<DataFrame>

Parameters

NameTypeDescription
pathstring-
columnsseq<string> (optional)-
nRowsuint64 (optional)-
parallelStrategyParallelStrategy (optional)-
lowMemorybool (optional)-
useStatisticsbool (optional)-
globbool (optional)-
allowMissingColumnsbool (optional)-
rechunkbool (optional)-
cachebool (optional)-
rowIndexNamestring (optional)-
rowIndexOffsetuint32 (optional)-
includePathColumnstring (optional)-
schemaPolarsSchema (optional)-
hivePartitioningbool (optional)-
hivePartitionSchemaPolarsSchema (optional)-
tryParseHiveDatesbool (optional)-
cloudOptionsCloudOptions (optional)-

create ​

Create a DataFrame from a list of Series.

Create a DataFrame from an array of Series.

fsharp
static member create(series: seq<Series>) : DataFrame
static member create([<ParamArray>] series: Series[]) : DataFrame

Parameters

NameTypeDescription
seriesseq<Series> / Series[]-

ofColumns ​

Creates a DataFrame from an F# anonymous record (or any SoA container) where fields are collections. Example: DataFrame.ofColumns {| Time = [| dt1; dt2 |]; Val = [| 1.0; 2.0 |] |}

Creates a DataFrame from a sequence of column pairs (Name * Array). Example: DataFrame.ofColumns [ "A", box [| 1; 2 |]; "B", box [| "x"; "y" |] ]

fsharp
static member ofColumns(columns: 'T) : DataFrame
static member ofColumns(columns: seq<(string * Array)>) : DataFrame

Parameters

NameTypeDescription
columns'T / seq<(string * Array)>-

ofMaps ​

Build a DataFrame from a sequence of Maps or dictionaries.

fsharp
static member ofMaps(data: seq<'a>, ?strict: bool, ?inferSchemaLength: uint32) : DataFrame

Parameters

NameTypeDescription
dataseq<'a>-
strictbool (optional)-
inferSchemaLengthuint32 (optional)-

ofRecords ​

Creates a DataFrame from an array or sequence of F# records. Uses Zero-Copy fast-path if all columns are supported primitives, dates, or options. Falls back to Arrow serialization for complex nested structs and lists.

fsharp
static member ofRecords(data: seq<'T>) : DataFrame

Parameters

NameTypeDescription
dataseq<'T>-

ofSeq ​

Create a DataFrame from a sequence of objects using Arrow streaming.

fsharp
static member ofSeq(data: seq<'T>, ?batchSize: int) : DataFrame

Parameters

NameTypeDescription
dataseq<'T>-
batchSizeint (optional)-

Instance Methods ​

AsDataReader ​

Export DataFrame As DbDataReader (Zero-Copy Enabled)

fsharp
member AsDataReader(?bufferSize: int, ?typeOverrides: Dictionary<string, Type>) : DbDataReader

Parameters

NameTypeDescription
bufferSizeint (optional)-
typeOverridesDictionary<string, Type> (optional)-

AsQueryable ​

Convert DataFrame into an IQueryable LINQ query provider. Operations will be translated to Polars Expressions and compiled into execution plans.

Directly creates an IQueryable with type inferred from an existing sample sequence

fsharp
member AsQueryable : unit -> IQueryable<'T>
member AsQueryable(sample: seq<'T>) : IQueryable<'T>

Parameters

NameTypeDescription
sampleseq<'T>-

AsTensor ​

Converts selected DataFrame columns into a managed 2D Row-Major Tensor [Rows, Columns]. Automatically handles memory fragmentation and performs the Column-Major to Row-Major transposition.

Converts all columns in the DataFrame into a managed 2D Row-Major Tensor.

fsharp
member AsTensor([<ParamArray>] columnNames: string[]) : Tensor<'T>
member AsTensor : unit -> Tensor<'T>

Parameters

NameTypeDescription
columnNamesstring[]-

BottomK ​

Get the bottom k rows based on the given columns.

fsharp
member BottomK(k: int, by: seq<'a>, ?reverse: seq<bool>) : DataFrame
member BottomK(k: int, by: seq<'a>, reverse: bool) : DataFrame

Parameters

NameTypeDescription
kint-
byseq<'a>-
reverseseq<bool> (optional)-

Cell ​

Get a value from the DataFrame using a generic type argument. Eliminates the need for unbox, but throws if type mismatches.

fsharp
member Cell(colName: string, rowIndex: int) : 'T
member Cell(rowIndex: int, colName: string) : 'T

Parameters

NameTypeDescription
colNamestring-
rowIndexint-

CellList ​

Helper to get a cell value as an F# List directly.

fsharp
member CellList(colName: string, row: int) : 'T list

Parameters

NameTypeDescription
colNamestring-
rowint-

Clear ​

Create an empty (n=0) or n-row null-filled (n>0) copy of the DataFrame. Returns a n-row null-filled DataFrame with an identical schema.

fsharp
member Clear(?n: int64) : DataFrame

Parameters

NameTypeDescription
nint64 (optional)Number of (null-filled) rows to return in the cleared frame.

Returns: A new DataFrame.


Clone ​

fsharp
member Clone : unit -> DataFrame

Column ​

fsharp
member Column(name: string) : Series
member Column(index: int64) : Series

Parameters

NameTypeDescription
namestring-
indexint64-

Count ​

Return the number of non-null elements for each column.

fsharp
member Count : unit -> DataFrame

Describe ​

Generate a summary statistics DataFrame (count, mean, std, min, 25%, 50%, 75%, max). Similar to pandas/polars describe().

fsharp
member Describe : unit -> DataFrame

Drop ​

Drop one or more columns from the DataFrame. Returns a new DataFrame.

Drop columns using Polars Selectors or Expressions.

fsharp
member Drop([<ParamArray>] columns: string[]) : DataFrame
member Drop(exprs: seq<Expr>) : DataFrame
member Drop([<ParamArray>] exprs: Expr[]) : DataFrame

Parameters

NameTypeDescription
columnsstring[]-
exprsseq<Expr> / Expr[]-

DropInPlace ​

Drop a column in-place and return it as a Series. Note: This mutates the original DataFrame.

fsharp
member DropInPlace(name: string) : Series

Parameters

NameTypeDescription
namestring-

DropNans ​

Drop rows containing one or more NaN values.

Drop rows with NaN in specific columns.

Drop rows with NaN by specific Expressions.

fsharp
member DropNans(?subset: Selector) : DataFrame
member DropNans([<ParamArray>] subset: string[]) : DataFrame
member DropNans([<ParamArray>] exprs: Expr[]) : DataFrame

Parameters

NameTypeDescription
subsetSelector (optional) / string[]-
exprsExpr[]-

DropNulls ​

Drop rows containing one or more Null values.

Drop rows with Nulls in specific columns.

Drop rows with Nulls by specific Expressions.

fsharp
member DropNulls(?subset: Selector) : DataFrame
member DropNulls([<ParamArray>] subset: string[]) : DataFrame
member DropNulls([<ParamArray>] exprs: Expr[]) : DataFrame

Parameters

NameTypeDescription
subsetSelector (optional) / string[]-
exprsExpr[]-

EstimatedSize ​

Return an estimation of the total (heap) allocated size of the DataFrame. Estimated size is given in the specified unit (bytes by default).

fsharp
member EstimatedSize(unit: SizeUnit) : float

Parameters

NameTypeDescription
unitSizeUnitScale the returned size to the given unit (uses 1024 base).

Returns: The estimated size as a double.


Explode ​

Explode list columns to rows using a Selector.

Explode list columns to rows using column names.

Explode a single column by name.

fsharp
member Explode(selector: Selector, ?emptyAsNull: bool, ?keepNulls: bool) : DataFrame
member Explode(columns: seq<string>, ?emptyAsNull: bool, ?keepNulls: bool) : DataFrame
member Explode(column: string, ?emptyAsNull: bool, ?keepNulls: bool) : DataFrame

Parameters

NameTypeDescription
selectorSelector-
emptyAsNullbool (optional)-
keepNullsbool (optional)-
columnsseq<string>-
columnstring-

ExportBatches ​

Export the DataFrame as a stream of Arrow RecordBatches (Zero-Copy). Calls 'onBatch' for each chunk in the DataFrame. Useful for custom eager sinks (e.g. WriteDatabase).

fsharp
member ExportBatches(onBatch: Action<RecordBatch>) : unit

Parameters

NameTypeDescription
onBatchAction<RecordBatch>-

Extend ​

Extend another DataFrame to this one. Checks that the schema matches. NChunks wont't change.

fsharp
member Extend(other: DataFrame) : DataFrame

Parameters

NameTypeDescription
otherDataFrame-

FillNan ​

Fill NaN values in all floating point columns with a specified value.

fsharp
member FillNan(fillValue: Expr) : DataFrame

Parameters

NameTypeDescription
fillValueExpr-

FillNull ​

Fill null values in all columns with a specified value.

fsharp
member FillNull(fillValue: Expr) : DataFrame

Parameters

NameTypeDescription
fillValueExpr-

Filter ​

Filter rows based on a boolean expression (predicate).

Filter rows based on a boolean Series.

fsharp
member Filter(expr: Expr) : DataFrame
member Filter(series: Series) : DataFrame
member Filter(mask: seq<bool>) : DataFrame

Parameters

NameTypeDescription
exprExpr-
seriesSeries-
maskseq<bool>-

Fold ​

Fold over all columns (left to right) using the first column as the initial accumulator. Throws if the DataFrame is empty.

Fold over all columns with a custom starting accumulator.

fsharp
member Fold(folder: (Series -> (Series -> Series))) : Series
member Fold(state: 'State, folder: ('State -> (Series -> 'State))) : 'State

Parameters

NameTypeDescription
folder(Series -> (Series -> Series)) / ('State -> (Series -> 'State))-
state'State-

Gather ​

Selects rows from this DataFrame at the given indices.

fsharp
member Gather(index: seq<int64>, ?nullOnOutOfBounds: bool) : DataFrame

Parameters

NameTypeDescription
indexseq<int64>The indices of the rows to select.
nullOnOutOfBoundsbool (optional)If true when an index is out-of-bounds a null row will be generated instead of raising an error.

GatherEvery ​

Take every nth row in the Frame and return as a new Frame.

fsharp
member GatherEvery(n: uint64, ?offset: uint64) : DataFrame

Parameters

NameTypeDescription
nuint64Gather every n-th row.
offsetuint64 (optional)Starting Index

GetColumns ​

Returns all columns as a Series array.

Get all columns as an array of Series. Order is guaranteed to match the physical column order.

fsharp
member GetColumns : unit -> Series[]

GetSlice ​

Slice the DataFrame using F# slicing syntax (e.g., df.[start..finish]). Note: F# slicing bounds are inclusive at the end.

fsharp
member GetSlice(start: int option, finish: int option) : DataFrame

Parameters

NameTypeDescription
startint option-
finishint option-

Glimpse ​

Print a dense preview of the DataFrame to the standard output.

fsharp
member Glimpse(?maxItemsPerColumn: int, ?maxColnameLength: int) : unit

Parameters

NameTypeDescription
maxItemsPerColumnint (optional)-
maxColnameLengthint (optional)-

GlimpseFrame ​

Return a dense preview of the DataFrame as a new DataFrame. Schema: "column" (String), "dtype" (String), "values" (List[String])

fsharp
member GlimpseFrame(?maxItemsPerColumn: int, ?maxColnameLength: int) : DataFrame

Parameters

NameTypeDescription
maxItemsPerColumnint (optional)-
maxColnameLengthint (optional)-

GlimpseString ​

Return a dense preview of the DataFrame as a formatted string.

fsharp
member GlimpseString(?maxItemsPerColumn: int, ?maxColnameLength: int) : string

Parameters

NameTypeDescription
maxItemsPerColumnint (optional)-
maxColnameLengthint (optional)-

GroupBy ​

fsharp
member GroupBy(keys: seq<Expr>, ?maintainOrder: bool) : GroupBy
member GroupBy(keys: seq<'c>, ?maintainOrder: bool) : GroupBy

Parameters

NameTypeDescription
keysseq<Expr> / seq<'c>-
maintainOrderbool (optional)-

GroupByDynamic ​

Start a dynamic group-by operation. Returns a Builder.

fsharp
member GroupByDynamic(
    indexCol: string,
    every: Dur,
    ?period: Dur,
    ?offset: Dur,
    ?by: seq<'b>,
    ?label: Label,
    ?includeBoundaries: bool,
    ?closedWindow: ClosedInterval,
    ?startBy: StartBy
) : GroupBy

Parameters

NameTypeDescription
indexColstring-
everyDur-
periodDur (optional)-
offsetDur (optional)-
byseq<'b> (optional)-
labelLabel (optional)-
includeBoundariesbool (optional)-
closedWindowClosedInterval (optional)-
startByStartBy (optional)-

GroupByRolling ​

Start a rolling group-by operation. Returns a Builder.

fsharp
member GroupByRolling(
    indexCol: string,
    period: Dur,
    ?offset: Dur,
    ?by: seq<'a>,
    ?closedWindow: ClosedInterval
) : GroupBy

Parameters

NameTypeDescription
indexColstring-
periodDur-
offsetDur (optional)-
byseq<'a> (optional)-
closedWindowClosedInterval (optional)-

HStack ​

Horizontally stack columns to the DataFrame. Returns a new DataFrame with the new columns appended.

fsharp
member HStack(columns: seq<Series>) : DataFrame

Parameters

NameTypeDescription
columnsseq<Series>-

HashRows ​

Hash and combine the rows in this DataFrame.

fsharp
member HashRows(?seed: uint64) : Series

Parameters

NameTypeDescription
seeduint64 (optional)-

Get the first n rows.

fsharp
member Head(?rows: int) : DataFrame

Parameters

NameTypeDescription
rowsint (optional)-

InsertColumn ​

Insert a column into the DataFrame at a specified index. Accepts a specific index and a Series to be inserted.

fsharp
member InsertColumn(index: int, column: Series) : DataFrame

Parameters

NameTypeDescription
indexintThe index at which to insert the column. Negative indices count from the end.
columnSeriesThe Series to insert as a column.

Interpolate ​

Interpolate intermediate values. The interpolation method is linear. Nulls at the beginning and end of the series remain null.

fsharp
member Interpolate : unit -> DataFrame

IsDuplicated ​

Get a mask of all duplicated rows in this DataFrame.

fsharp
member IsDuplicated : unit -> Series

IsFinite ​

fsharp
member IsFinite(col: string) : Series

Parameters

NameTypeDescription
colstring-

IsInfinite ​

fsharp
member IsInfinite(col: string) : Series

Parameters

NameTypeDescription
colstring-

IsNan ​

fsharp
member IsNan(col: string) : Series

Parameters

NameTypeDescription
colstring-

IsNotNan ​

fsharp
member IsNotNan(col: string) : Series

Parameters

NameTypeDescription
colstring-

IsNullAt ​

Check if the value at the specified column and row is null.

fsharp
member IsNullAt(col: string, row: int, ?uncheck: bool) : bool

Parameters

NameTypeDescription
colstring-
rowint-
uncheckbool (optional)-

IsSorted ​

Check whether the DataFrame is sorted by the given columns.

Single column overload for checking sort status.

fsharp
member IsSorted(by: seq<string>, ?descending: seq<bool>, ?nullsLast: seq<bool>) : bool
member IsSorted(by: string, ?descending: bool, ?nullsLast: bool) : bool

Parameters

NameTypeDescription
byseq<string>Column name(s) to check.
descendingseq<bool> (optional) / bool (optional)Sort in descending order. When sorting by multiple columns, can be specified per column by passing a sequence of booleans.
nullsLastseq<bool> (optional) / bool (optional)Place null values last. When sorting by multiple columns, can be specified per column by passing a sequence of booleans.

IsUnique ​

Get a mask of all unique rows in this DataFrame.

fsharp
member IsUnique : unit -> Series

Item ​

[Indexer] Access cell value by Row Index and Column Index. Syntax: df.[rowIndex, colIndex]

[Indexer] Access cell value by Row Index and Column Name. Syntax: df.[rowIndex, "colName"]

fsharp
member Item(columnName: string) : Series
member Item(columnIndex: int) : Series
member Item(rowIndex: int, columnName: string) : obj
member Item(rowIndex: int, columnIndex: int) : obj

Parameters

NameTypeDescription
columnNamestring-
columnIndexint-
rowIndexint-

Iter2 ​

Applies an action pairwise to strongly-typed rows from two equal-height DataFrames.

fsharp
member Iter2(other: DataFrame, action: ('T1 -> ('T2 -> unit))) : unit

Parameters

NameTypeDescription
otherDataFrame-
action('T1 -> ('T2 -> unit))-

IterRows ​

Applies the given action to each row in the DataFrame materialized as a strongly-typed F# Record or DTO. Utilizes pre-compiled expression tree hydration and hoisted Series handles for extreme throughput.

fsharp
member IterRows(action: ('T -> unit)) : unit

Parameters

NameTypeDescription
action('T -> unit)The side-effecting action executed for each row.

IterSlices ​

Returns an iterator over slices of the DataFrame.

fsharp
member IterSlices(?nRows: int) : seq<DataFrame>

Parameters

NameTypeDescription
nRowsint (optional)The number of rows per slice. Defaults to 10,000.

Iteri2 ​

Applies an action pairwise to strongly-typed rows from two DataFrames along with their 64-bit row index.

fsharp
member Iteri2(other: DataFrame, action: (int64 -> ('T1 -> ('T2 -> unit)))) : unit

Parameters

NameTypeDescription
otherDataFrame-
action(int64 -> ('T1 -> ('T2 -> unit)))-

IteriRows ​

Applies the given action to each row in the DataFrame along with its zero-based 64-bit row index.

fsharp
member IteriRows(action: (int64 -> ('T -> unit))) : unit

Parameters

NameTypeDescription
action(int64 -> ('T -> unit))The action executed for each row (int64 index -> 'T row -> unit).

Join ​

Join with another DataFrame.

Join with another DataFrame with single on Expr.

fsharp
member Join(
    other: DataFrame,
    leftOn: seq<Expr>,
    rightOn: seq<Expr>,
    how: JoinType,
    ?suffix: string,
    ?validation: JoinValidation,
    ?coalesce: JoinCoalesce,
    ?maintainOrder: JoinMaintainOrder,
    ?joinSide: JoinSide,
    ?nullsEqual: bool,
    ?sliceOffset: int64,
    ?sliceLen: uint64
) : DataFrame

member Join(
    other: DataFrame,
    on: seq<Expr>,
    how: JoinType,
    ?suffix: string,
    ?validation: JoinValidation,
    ?coalesce: JoinCoalesce,
    ?maintainOrder: JoinMaintainOrder,
    ?joinSide: JoinSide,
    ?nullsEqual: bool,
    ?sliceOffset: int64,
    ?sliceLen: uint64
) : DataFrame

Parameters

NameTypeDescription
otherDataFrameThe right DataFrame to join with.
leftOnseq<Expr>Column names in the left DataFrame to join on.
rightOnseq<Expr>Column names in the right DataFrame to join on.
howJoinTypeType of join (Inner, Left, Outer, Cross, etc.). Default is Inner.
suffixstring (optional)Suffix to append to columns with same name in right DataFrame. Default "_right".
validationJoinValidation (optional)Check if join keys are unique.
coalesceJoinCoalesce (optional)How to coalesce the join keys.
maintainOrderJoinMaintainOrder (optional)How to maintain the order of the join.
joinSideJoinSide (optional)Specifies the strategy for the hash join build side.
nullsEqualbool (optional)Consider nulls as equal.
sliceOffsetint64 (optional)Slice the result starting at this offset.
sliceLenuint64 (optional)Length of the slice.
onseq<Expr>-

JoinAsOf ​

Perform an As-of join (also known as a time-series join).

This is similar to a left join except that we match on nearest key rather than equal keys. The join keys must be sorted.

fsharp
member JoinAsOf(
    other: DataFrame,
    leftOn: Expr,
    rightOn: Expr,
    tolerance: Tolerance,
    ?byLeft: seq<Expr>,
    ?byRight: seq<Expr>,
    ?strategy: AsofStrategy,
    ?allowEq: bool,
    ?checkSorted: bool,
    ?suffix: string,
    ?validation: JoinValidation,
    ?coalesce: JoinCoalesce,
    ?maintainOrder: JoinMaintainOrder,
    ?joinSide: JoinSide,
    ?nullsEqual: bool,
    ?sliceOffset: int64,
    ?sliceLen: uint64
) : DataFrame

Parameters

NameTypeDescription
otherDataFrameThe right LazyFrame to join with.
leftOnExprJoin key of the left LazyFrame. Must be sorted.
rightOnExprJoin key of the right LazyFrame. Must be sorted.
toleranceToleranceTolerance as a time duration string (e.g., "2h", "10s", "1d"), int or double or TimeSpan. Matches that are further away than this duration are discarded.
byLeftseq<Expr> (optional)-
byRightseq<Expr> (optional)-
strategyAsofStrategy (optional)The strategy to determine which value is "nearest" (Backward, Forward, or Nearest). Defaults to AsofStrategy.Backward.
allowEqbool (optional)If true, allow exact matches to be included in the result. If false, a match must be strictly unequal (e.g. less than for Backward strategy) to the key.
checkSortedbool (optional)Check if the join keys are sorted. If false, the user must ensure keys are sorted; otherwise results are undefined (but execution is faster).
suffixstring (optional)Suffix to append to columns with name conflicts. Defaults to "_right".
validationJoinValidation (optional)Check if join keys are unique (mostly relevant for the 'by' columns).
coalesceJoinCoalesce (optional)How to coalesce the join keys.
maintainOrderJoinMaintainOrder (optional)How to maintain the order of the join.
joinSideJoinSide (optional)pecifies the strategy for the hash join build side.
nullsEqualbool (optional)Consider nulls as equal.
sliceOffsetint64 (optional)Slice the result starting at this offset (optimization).
sliceLenuint64 (optional)Length of the slice to keep.

JoinWhere ​

Join with another LazyFrame using multiple boolean expressions.

fsharp
member JoinWhere(
    other: DataFrame,
    predicates: seq<Expr>,
    ?how: JoinType,
    ?suffix: string,
    ?validation: JoinValidation,
    ?coalesce: JoinCoalesce,
    ?maintainOrder: JoinMaintainOrder,
    ?nullsEqual: bool
) : DataFrame

Parameters

NameTypeDescription
otherDataFrame-
predicatesseq<Expr>-
howJoinType (optional)-
suffixstring (optional)-
validationJoinValidation (optional)-
coalesceJoinCoalesce (optional)-
maintainOrderJoinMaintainOrder (optional)-
nullsEqualbool (optional)-

Lazy ​

Convert dataframe to lazyframe

fsharp
member Lazy : unit -> LazyFrame

Map ​

Transforms each column in the DataFrame using a column-wise mapping function (Series -> Series). Preserves the original column name if the mapped Series does not provide a new one.

fsharp
member Map(mapping: (Series -> Series)) : DataFrame

Parameters

NameTypeDescription
mapping(Series -> Series)The transformation function applied to each column Series.

Returns: A new DataFrame composed of the transformed Series.


MapRows ​

Transforms DataFrame rows into a new DataFrame using a strongly-typed F# Record mapping function ('TIn -> 'TOut). Combines compiled zero-allocation row enumerator with zero-reflection columnar transposition.

fsharp
member MapRows(mapping: ('TIn -> 'TOut)) : DataFrame

Parameters

NameTypeDescription
mapping('TIn -> 'TOut)The pure transformation function applied to each row.

Returns: A new DataFrame materialized from the mapped output records.


Max ​

Aggregate the columns in the Frame to their maximum value.

fsharp
member Max : unit -> DataFrame

Mean ​

Aggregate the columns in the Frame to their mean value.

fsharp
member Mean : unit -> DataFrame

Median ​

Aggregate the columns in the Frame to their median value.

fsharp
member Median : unit -> DataFrame

Melt ​

Alias for Unpivot.

Melt (Unpivot) overload for simple string lists. Auto-converts string seqs to Column Selectors.

fsharp
member Melt(
    index: Selector,
    on: Selector,
    ?variableName: string,
    ?valueName: string
) : DataFrame

member Melt(
    index: seq<string>,
    on: seq<string>,
    ?variableName: string,
    ?valueName: string
) : DataFrame

Parameters

NameTypeDescription
indexSelector / seq<string>-
onSelector / seq<string>-
variableNamestring (optional)-
valueNamestring (optional)-

Merge ​

Initiates a Merge (upsert) plan using this DataFrame as the target and the given source. Internally both frames are converted to LazyFrame, so the resulting MergePlan can still be executed eagerly by piping into Merge.executeEager.

fsharp
member Merge(source: DataFrame, on: IColumnExpr) : MergePlan

Parameters

NameTypeDescription
sourceDataFrameThe source DataFrame containing updates/inserts.
onIColumnExprA column expression or selector that resolves to the merge key columns.

Returns: A MergePlan backed by LazyFrames, ready for further configuration and execution.


MergeCatalogRecords ​

Starts building a Merge (Upsert) operation using this DataFrame as the source.

fsharp
member MergeCatalogRecords(
    catalog: UnityCatalog,
    catalogName: string,
    schemaName: string,
    tableName: string,
    mergeKeys: string[],
    ?canEvolve: bool,
    ?cloudOptions: CloudOptions
) : DeltaMergeBuilder

Parameters

NameTypeDescription
catalogUnityCatalog-
catalogNamestring-
schemaNamestring-
tableNamestring-
mergeKeysstring[]-
canEvolvebool (optional)-
cloudOptionsCloudOptions (optional)-

MergeDeltaOrdered ​

Starts a fluent builder to merge a DataFrame into a Delta Lake table with strict, order-preserving SQL MERGE semantics.

Unlike traditional merge methods, this builder guarantees that chained actions (Update, Delete, Insert) are evaluated exactly in the order they are defined. If no actions are specified before execution, it intelligently defaults to a standard Upsert (WhenMatchedUpdate + WhenNotMatchedInsert).

fsharp
member MergeDeltaOrdered(
    path: string,
    mergeKeys: seq<string>,
    ?canEvolve: bool,
    ?cloudOptions: CloudOptions
) : DeltaMergeBuilder

Parameters

NameTypeDescription
pathstringThe URI to the target Delta Lake table (local or cloud).
mergeKeysseq<string>The column names to join on (must exist in both the Source DataFrame and Target Delta table).
canEvolvebool (optional)If set to true, allows schema evolution (e.g., adding new columns from the Source to the Target). Default is false.
cloudOptionsCloudOptions (optional)Cloud storage credentials and configuration (e.g., AWS S3, Azure Blob).

Returns: A DeltaMergeBuilder instance used to chain match conditions, culminating in a call to .Execute().


MergeSorted ​

Take two sorted DataFrames and merge them by the sorted key.

fsharp
member MergeSorted(other: DataFrame, key: string, ?maintainOrder: bool) : DataFrame
member MergeSorted(other: DataFrame, key: string[], ?maintainOrder: bool) : DataFrame

Parameters

NameTypeDescription
otherDataFrameOther DataFrame that must be merged
keystring / string[]Key that is sorted.
maintainOrderbool (optional)If True, the output is guaranteed to have left-biased ordering for equal keys: rows from the left frame appear before rows from the right frame when their keys are equal.

Min ​

Aggregate the columns in the Frame to their minimum value.

fsharp
member Min : unit -> DataFrame

NChunks ​

Get the number of chunks used by the first Column of this DataFrame.

fsharp
member NChunks : unit -> int64

NChunksAll ​

Get an array containing the number of chunks for all columns in this DataFrame.

fsharp
member NChunksAll : unit -> int64[]

NUnique ​

Return the number of unique rows, or the number of unique row-subsets.

fsharp
member NUnique(?subset: seq<string>) : int64
member NUnique([<ParamArray>] subset: Expr[]) : int64

Parameters

NameTypeDescription
subsetseq<string> (optional) / Expr[]-

NullCount ​

Aggregate the columns in the Frame as the sum of their null value count.

Get the number of null values in a specific column.

fsharp
member NullCount : unit -> DataFrame
member NullCount(colName: string) : int64

Parameters

NameTypeDescription
colNamestring-

PartitionBy ​

Group by the given columns and return the groups as separate dataframes.

Group by a single column and return the groups as separate dataframes.

fsharp
member PartitionBy(byCols: seq<string>, ?maintainOrder: bool, ?includeKey: bool) : DataFrame[]
member PartitionBy(byCol: string, ?maintainOrder: bool, ?includeKey: bool) : DataFrame[]

Parameters

NameTypeDescription
byColsseq<string>-
maintainOrderbool (optional)-
includeKeybool (optional)-
byColstring-

PartitionMap ​

Partitions the DataFrame by a single column and associates each partition with its strongly-typed key in an immutable F# Map.

Partitions the DataFrame by two columns and associates each partition with a strongly-typed tuple key in an immutable F# Map.

Partitions the DataFrame by the specified columns and hydrates each partition's key into an F# Record or composite key.

Partitions the DataFrame using an F# Record key, automatically inferring partition column names from 'Key record fields.

Partitions the DataFrame by arbitrary multiple columns and associates each partition with an untyped PartitionKey in an immutable F# Map.

fsharp
member PartitionMap(byCol: string, ?maintainOrder: bool) : Map<'Key, DataFrame>
member PartitionMap(col1: string, col2: string, ?maintainOrder: bool) : Map<('K1 * 'K2), DataFrame>
member PartitionMap(byCols: seq<string>, ?maintainOrder: bool) : Map<'Key, DataFrame>
member PartitionMap(?maintainOrder: bool) : Map<'Key, DataFrame>
member PartitionMap(byCols: seq<string>, ?maintainOrder: bool) : Map<PartitionKey, DataFrame>

Parameters

NameTypeDescription
byColstring-
maintainOrderbool (optional)Ensure consistent group ordering. Default is true.
col1string-
col2string-
byColsseq<string>Column names to partition by.

Pipe ​

Offers a structured way to apply a sequence of user-defined functions (UDFs).

fsharp
member Pipe(func: (DataFrame -> 'T)) : 'T

Parameters

NameTypeDescription
func(DataFrame -> 'T)A function that receives the current expression and returns a value of type T. Typically this function wraps several Polars API calls that operate on the given expression.

Returns: The result of applying func to this DataFrame.


Pivot ​

Pivot the DataFrame from long to wide format.

Pivot the DataFrame using column names.

Pivot the DataFrame using column names and a custom aggregation expression.

fsharp
member Pivot(
    index: Selector,
    columns: Selector,
    values: Selector,
    ?aggregateExpr: Expr,
    ?aggregateFunction: PivotAgg,
    ?sortColumns: bool,
    ?maintainOrder: bool,
    ?separator: string,
    ?columnNaming: PivotColumnNaming
) : DataFrame

member Pivot(
    index: seq<string>,
    columns: seq<string>,
    values: seq<string>,
    ?aggFn: PivotAgg,
    ?sortColumns: bool,
    ?maintainOrder: bool,
    ?separator: string,
    ?columnNaming: PivotColumnNaming
) : DataFrame

member Pivot(
    index: seq<string>,
    columns: seq<string>,
    values: seq<string>,
    aggExpr: Expr,
    ?sortColumns: bool,
    ?maintainOrder: bool,
    ?separator: string,
    ?columnNaming: PivotColumnNaming
) : DataFrame

Parameters

NameTypeDescription
indexSelector / seq<string>Selector for the index column(s) (the rows).
columnsSelector / seq<string>Selector for the column(s) to pivot (the new column headers).
valuesSelector / seq<string>Selector for the value column(s) to populate the cells.
aggregateExprExpr (optional)Optional expression to aggregate the values. If null, uses aggregateFunction.
aggregateFunctionPivotAgg (optional)Aggregation function to use if aggregateExpr is null. Default is First.
sortColumnsbool (optional)Sort the pivoted columns.
maintainOrderbool (optional)Maintain the order of the data.
separatorstring (optional)Separator used to combine column names when multiple value columns are selected.
columnNamingPivotColumnNaming (optional)Controls how column names are constructed. Default is Auto.
aggFnPivotAgg (optional)-
aggExprExpr-

PrintSchema ​

Print schema in a readable format.

fsharp
member PrintSchema : unit -> unit

Quantile ​

Aggregate the columns in the Frame to their quantile value.

fsharp
member Quantile(quantile: float, ?method: QuantileMethod) : DataFrame

Parameters

NameTypeDescription
quantilefloatQuantile between 0.0 and 1.0.
methodQuantileMethod (optional)['nearest’, ‘higher’, ‘lower’, ‘midpoint’, ‘linear’] Interpolation method.

Rechunk ​

Rechunk the data in this DataFrame to a contiguous allocation. This will make sure all subsequent operations have optimal and predictable performance.

fsharp
member Rechunk : unit -> DataFrame

Remove ​

fsharp
member Remove(predicate: Expr) : LazyFrame
member Remove(predicate: Series) : LazyFrame
member Remove(mask: seq<bool>) : LazyFrame

Parameters

NameTypeDescription
predicateExpr / Series-
maskseq<bool>-

Rename ​

Rename a column. Returns a new DataFrame.

Rename a list of columns.

Rename columns using a sequence of (oldName, newName) tuples. Example: df.Rename [ "colA", "col1"; "colB", "col2" ]

Rename columns using a dictionary mapping old names to new names. Example: df.Rename (dict [ "colA", "col1"; "colB", "col2" ])

fsharp
member Rename(oldName: string, newName: string) : DataFrame
member Rename(oldNames: seq<string>, newNames: seq<string>) : DataFrame
member Rename(mapping: seq<(string * string)>) : DataFrame
member Rename(mapping: IReadOnlyDictionary<string, string>) : DataFrame

Parameters

NameTypeDescription
oldNamestring-
newNamestring-
oldNamesseq<string>-
newNamesseq<string>-
mappingseq<(string * string)> / IReadOnlyDictionary<string, string>-

ReplaceColumn ​

Replace a column by its index in-place. Supports negative indexing (e.g., -1 replaces the last column).

Replace a column by its name in-place.

fsharp
member ReplaceColumn(index: int, newColumn: Series, ?keepName: bool) : DataFrame
member ReplaceColumn(columnName: string, newColumn: Series, ?keepName: bool) : DataFrame

Parameters

NameTypeDescription
indexintThe index of the column to replace. Negative values count from the end.
newColumnSeriesThe new Series to insert.
keepNamebool (optional)If true, keeps the original column name. If false, uses the new Series's name. Default is false.
columnNamestringThe name of the column to replace.

Returns: The current DataFrame instance to support method chaining.


Reverse ​

Reverse the DataFrame.

fsharp
member Reverse : unit -> DataFrame

Row ​

Get data for a specific row as an object array. Similar to DataTable.Rows[i].ItemArray.

fsharp
member Row(index: int) : obj[]

Parameters

NameTypeDescription
indexint-

Rows ​

Returns a zero-allocation stack enumerator for strongly-typed row hydration. Supports F# Records and parameterless DTOs. Usage: for row in df.Rows{MyRecord}() do ...

fsharp
member Rows : unit -> RowEnumerator<'T>

RowsAsync ​

Streams in-memory DataFrame rows asynchronously as strongly-typed F# Records/Tuples/DTOs. Serves as the asynchronous counterpart to DataFrame.Rows<'T>().

fsharp
member RowsAsync(?chunkSize: int, ?cancellationToken: CancellationToken) : IAsyncEnumerable<'T>

Parameters

NameTypeDescription
chunkSizeint (optional)-
cancellationTokenCancellationToken (optional)-

Sample ​

Sample n rows from the DataFrame.

Sample a fraction of rows from the DataFrame.

fsharp
member Sample(
    n: int,
    ?withReplacement: bool,
    ?shuffle: bool,
    ?seed: uint64
) : DataFrame

member Sample(
    frac: float,
    ?withReplacement: bool,
    ?shuffle: bool,
    ?seed: uint64
) : DataFrame

Parameters

NameTypeDescription
nint-
withReplacementbool (optional)-
shufflebool (optional)-
seeduint64 (optional)-
fracfloat-

Select ​

Select columns using expressions.

Select a single column using an expression. Usage: df.Select(pl.col("A"))

Select columns using generic column expressions (Expr or Selectors).

fsharp
member Select(exprs: seq<Expr>) : DataFrame
member Select(selector: Selector) : DataFrame
member Select(columns: seq<'b>) : DataFrame
member Select(expr: Expr) : DataFrame

Parameters

NameTypeDescription
exprsseq<Expr>-
selectorSelector-
columnsseq<'b>-
exprExpr-

SetSorted ​

fsharp
member SetSorted(columns: Selector, ?descending: bool, ?nullsLast: bool) : DataFrame

Parameters

NameTypeDescription
columnsSelector-
descendingbool (optional)-
nullsLastbool (optional)-

Show ​

Print the DataFrame to Console (Stdout).

fsharp
member Show : unit -> unit

ShrinkToFit ​

Shrink DataFrame memory usage.

fsharp
member ShrinkToFit : unit -> DataFrame

Returns: A new DataFrame


ShrinkToFitInplace ​

Shrink DataFrame memory usage.This won't return a new DataFrame

fsharp
member ShrinkToFitInplace : unit -> unit

Slice ​

Slice the DataFrame along the rows. Negative offsets count from the end of the DataFrame. If length is omitted, it slices to the end of the DataFrame.

fsharp
member Slice(offset: int64, ?length: uint64) : DataFrame

Parameters

NameTypeDescription
offsetint64-
lengthuint64 (optional)-

Sort ​

Sort the DataFrame.

Sort by a single column name.

Sort with simple broadcasting options.

Sort by a single expression.

fsharp
member Sort(
    columns: seq<IColumnExpr>,
    descending: seq<bool>,
    nullsLast: seq<bool>,
    ?maintainOrder: bool
) : DataFrame

member Sort(
    columns: seq<Expr>,
    descending: seq<bool>,
    nullsLast: seq<bool>,
    ?maintainOrder: bool
) : DataFrame

member Sort(
    columns: seq<IColumnExpr>,
    ?descending: bool,
    ?nullsLast: bool,
    ?maintainOrder: bool
) : DataFrame

member Sort(
    columns: seq<Expr>,
    ?descending: bool,
    ?nullsLast: bool,
    ?maintainOrder: bool
) : DataFrame

member Sort(expr: Expr, ?descending: bool, ?nullsLast: bool) : DataFrame
member Sort(
    colName: string,
    ?descending: bool,
    ?nullsLast: bool,
    ?maintainOrder: bool
) : DataFrame

Parameters

NameTypeDescription
columnsseq<IColumnExpr> / seq<Expr>the column which needs to be sorted (Expr/Selector)。
descendingseq<bool> / bool (optional)sort direction (true=descending).Length must be 1 (broadcasting) or same with columns.
nullsLastseq<bool> / bool (optional)null value position (true=last).Length must be 1 (broadcasting) or same with columns
maintainOrderbool (optional)Stable Sort option
exprExpr-
colNamestring-

Std ​

Aggregate the columns in the Frame to their standard deviation value.

fsharp
member Std(?ddof: byte) : DataFrame

Parameters

NameTypeDescription
ddofbyte (optional)“Delta Degrees of Freedom”: the divisor used in the calculation is N - ddof, where N represents the number of elements. By default ddof is 1.

Sum ​

Aggregate the columns in the Frame to their sum value.

fsharp
member Sum : unit -> DataFrame

Tail ​

Get the last n rows.

fsharp
member Tail(?n: int) : DataFrame

Parameters

NameTypeDescription
nint (optional)-

Take ​

Take rows by physical integer indices. Note: Negative indices are not supported. All values must be >= 0.

fsharp
member Take(indices: Series) : DataFrame

Parameters

NameTypeDescription
indicesSeriesA Series containing integer indices (e.g., UInt32, Int32).

ToArrow ​

fsharp
member ToArrow : unit -> RecordBatch

ToArrowStream ​

Export DataFrame to Arrow C Data Interface Stream. Supports zero-copy and lazy chunked reading.

Export DataFrame to Arrow C Data Interface Stream with Column Pruning.

Export DataFrame to Arrow C Data Interface Stream with Column Pruning (Array friendly).

fsharp
member ToArrowStream(?seed: uint64) : IArrowArrayStream
member ToArrowStream(columnIndices: ReadOnlySpan<int>, ?seed: uint64) : IArrowArrayStream
member ToArrowStream(columnIndices: int[], ?seed: uint64) : IArrowArrayStream

Parameters

NameTypeDescription
seeduint64 (optional)Optional seed for Native Global Shuffle.
columnIndicesReadOnlySpan<int> / int[]Column indices to prune the export (Projection Pushdown).

Returns: Standard IArrowArrayStream


ToAsyncEnumerable ​

Streams in-memory DataFrame rows asynchronously as strongly-typed F# Records/Tuples/DTOs. Uses cooperative task slicing to prevent thread pool starvation during large scans.

fsharp
member ToAsyncEnumerable(?chunkSize: int, ?cancellationToken: CancellationToken) : IAsyncEnumerable<'T>

Parameters

NameTypeDescription
chunkSizeint (optional)-
cancellationTokenCancellationToken (optional)-

ToDummies ​

Convert categorical columns to dummy/one-hot encoded variables.

fsharp
member ToDummies(
    ?columns: seq<string>,
    ?separator: string,
    ?dropFirst: bool,
    ?dropNulls: bool
) : DataFrame

Parameters

NameTypeDescription
columnsseq<string> (optional)Optional. Specific column names to convert. If omitted, all string and categorical columns are converted.
separatorstring (optional)The separator between the original column name and the dummy category. Default is "_".
dropFirstbool (optional)If true, drops the first dummy column to avoid multicollinearity. Default is false.
dropNullsbool (optional)If true, drops dummy columns representing null values. Default is false.

Returns: A new DataFrame with dummy variables.


ToHtml ​

Generates a rich HTML table representation of the DataFrame for interactive environments (e.g., LINQPad, Jupyter).

fsharp
member ToHtml : unit -> string

Returns: An HTML string representing the preview of the DataFrame.


ToMap ​

Convert the DataFrame to a dictionary of column name to Series.

fsharp
member ToMap : unit -> Map<string, Series>

ToRecordList ​

Materializes all DataFrame rows into an F# list of records.

fsharp
member ToRecordList : unit -> 'T list

ToRecords ​

Converts the DataFrame rows to a sequence of F# Record instances. Throws ArgumentException if 'T is not an F# Record type.

fsharp
member ToRecords : unit -> seq<'T>

ToStruct ​

Convert a DataFrame to a Series of type Struct.

fsharp
member ToStruct(?name: string) : Series

Parameters

NameTypeDescription
namestring (optional)Name for the struct Series.

TopK ​

Get the top k rows based on the given columns. This is often faster than a full sort followed by a head.

fsharp
member TopK(k: int, by: seq<'a>, ?reverse: seq<bool>) : DataFrame
member TopK(k: int, by: seq<'a>, reverse: bool) : DataFrame

Parameters

NameTypeDescription
kintNumber of rows to return.
byseq<'a>Columns to sort by.
reverseseq<bool> (optional)Sort direction per column. Default is false (no reverse).

Transpose ​

Transpose a DataFrame over the diagonal.

Transpose a DataFrame over the diagonal, using an existing column for column names.

Transpose a DataFrame over the diagonal, using custom names for transposed columns.

fsharp
member Transpose(?includeHeader: bool, ?headerName: string) : DataFrame
member Transpose(columnName: string, ?includeHeader: bool, ?headerName: string) : DataFrame
member Transpose(customNames: seq<string>, ?includeHeader: bool, ?headerName: string) : DataFrame

Parameters

NameTypeDescription
includeHeaderbool (optional)If true, the column names will be added as the first column.
headerNamestring (optional)Name of the header column if includeHeader is true (default "column").
columnNamestringExisting column name to use for naming transposed columns.
customNamesseq<string>Sequence of names for the value columns in the transposed data.

Unique ​

Return the number of unique rows, or the number of unique row-subsets.

Return unique rows from the DataFrame with a condition.

fsharp
member Unique(
    ?subset: seq<string>,
    ?keep: UniqueKeepStrategy,
    ?maintainOrder: bool,
    ?offset: int64,
    ?len: int64
) : DataFrame

member Unique(
    subset: seq<Expr>,
    ?keep: UniqueKeepStrategy,
    ?maintainOrder: bool,
    ?offset: int64,
    ?len: int64
) : DataFrame

Parameters

NameTypeDescription
subsetseq<string> (optional) / seq<Expr>-
keepUniqueKeepStrategy (optional)-
maintainOrderbool (optional)-
offsetint64 (optional)-
lenint64 (optional)-

UnnestColumn ​

Decompose a struct column into multiple columns.

fsharp
member UnnestColumn(column: string, ?separator: string) : DataFrame

Parameters

NameTypeDescription
columnstring-
separatorstring (optional)-

UnnestColumns ​

Decompose multiple struct columns.

fsharp
member UnnestColumns(columns: seq<string>, ?separator: string) : DataFrame

Parameters

NameTypeDescription
columnsseq<string>-
separatorstring (optional)-

Unpivot ​

Unpivot (Melt) the DataFrame from wide to long format using Selectors. This is the primary implementation backed by native binding.

Unpivot (Melt) overload for simple string lists. Auto-converts string lists to Column Selectors.

fsharp
member Unpivot(
    index: Selector,
    on: Selector,
    ?variableName: string,
    ?valueName: string
) : DataFrame

member Unpivot(
    index: seq<string>,
    on: seq<string>,
    ?variableName: string,
    ?valueName: string
) : DataFrame

Parameters

NameTypeDescription
indexSelector / seq<string>Selector for ID variables (columns to keep)
onSelector / seq<string>Selector for Value variables (columns to melt)
variableNamestring (optional)Name for the variable column (default: "variable")
valueNamestring (optional)Name for the value column (default: "value")

Unstack ​

Unstack a long table to a wide form without doing an aggregation. This can be much faster than a pivot, because it can skip the grouping phase.

fsharp
member Unstack(
    step: int64,
    ?columns: Selector,
    ?how: UnstackDirection,
    ?fillValues: seq<Expr>
) : DataFrame

Parameters

NameTypeDescription
stepint64Number of rows in the unstacked frame.
columnsSelector (optional)Column name(s) or selector(s) to include in the operation. If set to None (default), use all columns.
howUnstackDirection (optional)Direction of the unstack.
fillValuesseq<Expr> (optional)Fill values that don’t fit the new size with this value.

UnstackInternal ​

fsharp
member UnstackInternal(
    step: int64,
    how: UnstackDirection,
    resolvedColumns: string[],
    ?fillValues: seq<Expr>
) : DataFrame

Parameters

NameTypeDescription
stepint64-
howUnstackDirection-
resolvedColumnsstring[]-
fillValuesseq<Expr> (optional)-

Update ​

fsharp
member Update(
    other: DataFrame,
    ?on: IColumnExpr,
    ?how: JoinType,
    ?leftOn: IColumnExpr,
    ?rightOn: IColumnExpr,
    ?includeNulls: bool,
    ?maintainOrder: JoinMaintainOrder
) : DataFrame

Parameters

NameTypeDescription
otherDataFrame-
onIColumnExpr (optional)-
howJoinType (optional)-
leftOnIColumnExpr (optional)-
rightOnIColumnExpr (optional)-
includeNullsbool (optional)-
maintainOrderJoinMaintainOrder (optional)-

Upsample ​

Upsample a DataFrame at a regular frequency.

fsharp
member Upsample(
    timeColumn: Selector,
    every: Dur,
    ?groupBy: Selector,
    ?maintainOrder: bool
) : DataFrame

Parameters

NameTypeDescription
timeColumnSelectorThe column used for the time/datetime index. Must resolve to exactly one column.
everyDurThe interval to upsample to (e.g., Duration.String "1d", or Duration.TimeSpan ts).
groupBySelector (optional)Optional. Group by this selector before upsampling.
maintainOrderbool (optional)If true, maintains the original order of the groups. Default is false.

Returns: A new DataFrame with missing time steps filled with nulls.


VStack ​

Vertically stack another DataFrame to this one. Checks that the schema matches.

fsharp
member VStack(other: DataFrame) : DataFrame

Parameters

NameTypeDescription
otherDataFrame-

Var ​

Aggregate the columns in the Frame to their variance value.

fsharp
member Var(?ddof: byte) : DataFrame

Parameters

NameTypeDescription
ddofbyte (optional)“Delta Degrees of Freedom”: the divisor used in the calculation is N - ddof, where N represents the number of elements. By default ddof is 1.

WithColumns ​

Add or replace columns using expressions.

Add or replace columns using generic column expressions (Expr or Selectors).

fsharp
member WithColumns(exprs: seq<Expr>) : DataFrame
member WithColumns(columns: seq<'a>) : DataFrame
member WithColumns(expr: Expr) : DataFrame

Parameters

NameTypeDescription
exprsseq<Expr>-
columnsseq<'a>-
exprExpr-

WithRowIndex ​

Add a column at index 0 that counts the rows.

This can be useful to generate a unique index or to maintain order in operations that would otherwise discard it.

fsharp
member WithRowIndex(?name: string, ?offset: int) : DataFrame

Parameters

NameTypeDescription
namestring (optional)The name of the new row index column. Defaults to "index".
offsetint (optional)The starting value of the row index. Defaults to 0.

Returns: A new DataFrame with the row index column added.


WriteAvro ​

Write the DataFrame to an Apache Avro file.

fsharp
member WriteAvro(path: string, ?compression: AvroCompression, ?name: string) : unit

Parameters

NameTypeDescription
pathstringThe file path to write to.
compressionAvroCompression (optional)The compression algorithm to use.
namestring (optional)The name of the Avro record.

WriteAvroMemory ​

Write the DataFrame to an Apache Avro memory buffer.

fsharp
member WriteAvroMemory(?compression: AvroCompression, ?name: string) : byte[]

Parameters

NameTypeDescription
compressionAvroCompression (optional)The compression algorithm to use.
namestring (optional)The name of the Avro record.

Returns: A byte array containing the Avro data.


WriteCatalogTable ​

Writes the DataFrame into a Unity Catalog table by converting it to a LazyFrame.

fsharp
member WriteCatalogTable(
    catalog: UnityCatalog,
    catalogName: string,
    schemaName: string,
    tableName: string,
    ?partitionBy: Selector,
    ?mode: DeltaSaveMode,
    ?canEvolve: bool,
    ?includeKeys: bool,
    ?keysPreGrouped: bool,
    ?maxRowsPerFile: int,
    ?approxBytesPerFile: int64,
    ?compression: ParquetCompression,
    ?compressionLevel: int,
    ?statistics: bool,
    ?rowGroupSize: uint32,
    ?dataPageSize: uint32,
    ?compatLevel: int,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?cloudOptions: CloudOptions
) : unit

Parameters

NameTypeDescription
catalogUnityCatalog-
catalogNamestring-
schemaNamestring-
tableNamestring-
partitionBySelector (optional)-
modeDeltaSaveMode (optional)-
canEvolvebool (optional)-
includeKeysbool (optional)-
keysPreGroupedbool (optional)-
maxRowsPerFileint (optional)-
approxBytesPerFileint64 (optional)-
compressionParquetCompression (optional)-
compressionLevelint (optional)-
statisticsbool (optional)-
rowGroupSizeuint32 (optional)-
dataPageSizeuint32 (optional)-
compatLevelint (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
cloudOptionsCloudOptions (optional)-

WriteCsv ​

Write DataFrame to a comma-separated values (CSV) file.

This uses the Lazy execution engine internally to support streaming and cloud storage.

fsharp
member WriteCsv(
    path: string,
    ?includeHeader: bool,
    ?includeBom: bool,
    ?separator: char,
    ?quoteChar: char,
    ?quoteStyle: QuoteStyle,
    ?nullValue: string,
    ?lineTerminator: string,
    ?floatScientific: bool,
    ?floatPrecision: int,
    ?decimalComma: bool,
    ?dateFormat: string,
    ?timeFormat: string,
    ?datetimeFormat: string,
    ?checkExtension: bool,
    ?compression: ExternalCompression,
    ?compressionLevel: int,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?batchSize: int,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstring-
includeHeaderbool (optional)-
includeBombool (optional)-
separatorchar (optional)-
quoteCharchar (optional)-
quoteStyleQuoteStyle (optional)-
nullValuestring (optional)-
lineTerminatorstring (optional)-
floatScientificbool (optional)-
floatPrecisionint (optional)-
decimalCommabool (optional)-
dateFormatstring (optional)-
timeFormatstring (optional)-
datetimeFormatstring (optional)-
checkExtensionbool (optional)-
compressionExternalCompression (optional)-
compressionLevelint (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
batchSizeint (optional)-
cloudOptionsCloudOptions (optional)-

WriteCsvMemory ​

Write DataFrame to a CSV format in memory.

fsharp
member WriteCsvMemory(
    ?includeBom: bool,
    ?includeHeader: bool,
    ?batchSize: int,
    ?checkExtension: bool,
    ?compressionCode: ExternalCompression,
    ?compressionLevel: int,
    ?dateFormat: string,
    ?timeFormat: string,
    ?datetimeFormat: string,
    ?floatScientific: int,
    ?floatPrecision: int,
    ?decimalComma: bool,
    ?separator: byte,
    ?quoteChar: byte,
    ?nullValue: string,
    ?lineTerminator: string,
    ?quoteStyle: QuoteStyle,
    ?maintainOrder: bool
) : byte[]

Parameters

NameTypeDescription
includeBombool (optional)-
includeHeaderbool (optional)-
batchSizeint (optional)-
checkExtensionbool (optional)-
compressionCodeExternalCompression (optional)-
compressionLevelint (optional)-
dateFormatstring (optional)-
timeFormatstring (optional)-
datetimeFormatstring (optional)-
floatScientificint (optional)-
floatPrecisionint (optional)-
decimalCommabool (optional)-
separatorbyte (optional)-
quoteCharbyte (optional)-
nullValuestring (optional)-
lineTerminatorstring (optional)-
quoteStyleQuoteStyle (optional)-
maintainOrderbool (optional)-

Returns: A byte array containing the serialized CSV data.


WriteCsvPartitioned ​

Write DataFrame to a partitioned comma-separated values (CSV) file.

This uses the Lazy execution engine internally to support streaming and cloud storage.

fsharp
member WriteCsvPartitioned(
    path: string,
    partitionBy: Selector,
    ?includeKeys: bool,
    ?keysPreGrouped: bool,
    ?maxRowsPerFile: int,
    ?approxBytesPerFile: int64,
    ?includeHeader: bool,
    ?includeBom: bool,
    ?separator: char,
    ?quoteChar: char,
    ?quoteStyle: QuoteStyle,
    ?nullValue: string,
    ?lineTerminator: string,
    ?floatScientific: bool,
    ?floatPrecision: int,
    ?decimalComma: bool,
    ?dateFormat: string,
    ?timeFormat: string,
    ?datetimeFormat: string,
    ?checkExtension: bool,
    ?compression: ExternalCompression,
    ?compressionLevel: int,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?batchSize: int,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstring-
partitionBySelector-
includeKeysbool (optional)-
keysPreGroupedbool (optional)-
maxRowsPerFileint (optional)-
approxBytesPerFileint64 (optional)-
includeHeaderbool (optional)-
includeBombool (optional)-
separatorchar (optional)-
quoteCharchar (optional)-
quoteStyleQuoteStyle (optional)-
nullValuestring (optional)-
lineTerminatorstring (optional)-
floatScientificbool (optional)-
floatPrecisionint (optional)-
decimalCommabool (optional)-
dateFormatstring (optional)-
timeFormatstring (optional)-
datetimeFormatstring (optional)-
checkExtensionbool (optional)-
compressionExternalCompression (optional)-
compressionLevelint (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
batchSizeint (optional)-
cloudOptionsCloudOptions (optional)-

WriteDelta ​

Write the DataFrame to a Delta Lake table with partition discovery.

This operation performs a "blind write" of partitioned Parquet files (Hive-style) and then commits a transaction to the Delta Log, registering the new files.

fsharp
member WriteDelta(
    path: string,
    ?partitionBy: Selector,
    ?mode: DeltaSaveMode,
    ?canEvolve: bool,
    ?includeKeys: bool,
    ?keysPreGrouped: bool,
    ?maxRowsPerFile: int,
    ?approxBytesPerFile: int64,
    ?compression: ParquetCompression,
    ?compressionLevel: int,
    ?statistics: bool,
    ?rowGroupSize: uint32,
    ?dataPageSize: uint32,
    ?compatLevel: int,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?cloudOptions: CloudOptions
) : unit

Parameters

NameTypeDescription
pathstringPath to the root of the Delta Table. Can be local (e.g. "./data/table") or remote (e.g. "s3://bucket/table").
partitionBySelector (optional)The selector(s) to partition the data by. Directories will be created in the format "col=value".
modeDeltaSaveMode (optional)Save mode (Append, Overwrite, ErrorIfExists, Ignore). Default is Append.
canEvolvebool (optional)-
includeKeysbool (optional)Whether to include the partition keys in the Parquet files themselves. Default is true (recommended for Delta Lake compatibility).
keysPreGroupedbool (optional)Assert that the keys are already pre-grouped. This can speed up the operation if true.
maxRowsPerFileint (optional)Maximum number of rows per file. 0 means no limit.
approxBytesPerFileint64 (optional)Approximate size in bytes per file. 0 means no limit.
compressionParquetCompression (optional)Compression codec to use (Snappy, Zstd, etc.).
compressionLevelint (optional)Compression level (depends on the codec).
statisticsbool (optional)Write statistics to the Parquet file. Delta Lake uses these stats for data skipping, so 'true' is highly recommended.
rowGroupSizeuint32 (optional)Target row group size (in rows).
dataPageSizeuint32 (optional)Target data page size (in bytes).
compatLevelint (optional)IPC format compatibility.
maintainOrderbool (optional)Maintain the order of the data.
syncOnCloseSyncOnClose (optional)Whether to sync the file to disk on close.
mkdirbool (optional)Create parent directories if they don't exist.
cloudOptionsCloudOptions (optional)Options for cloud storage authentication and configuration.

WriteExcel ​

Write the DataFrame to an Excel file (.xlsx) using the native high-performance engine.

UInt64, Int128, UInt128 are automatically written as Text to preserve precision.

fsharp
member WriteExcel(
    path: string,
    ?sheetName: string,
    ?dateFormat: string,
    ?datetimeFormat: string
) : unit

Parameters

NameTypeDescription
pathstringDestination file path.
sheetNamestring (optional)Optional sheet name (default: "Sheet1").
dateFormatstring (optional)Optional Excel format string for Date columns (e.g. "yyyy-mm-dd").
datetimeFormatstring (optional)Optional Excel format string for Datetime columns (e.g. "yyyy-mm-dd hh:mm:ss").

WriteIpc ​

Write DataFrame to an IPC (Arrow/Feather) file.

This uses the Lazy execution engine internally to support streaming and cloud storage.

fsharp
member WriteIpc(
    path: string,
    ?compression: IpcCompression,
    ?compatLevel: int,
    ?recordBatchSize: int,
    ?recordBatchStatistics: bool,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstring-
compressionIpcCompression (optional)-
compatLevelint (optional)-
recordBatchSizeint (optional)-
recordBatchStatisticsbool (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
cloudOptionsCloudOptions (optional)-

WriteIpcMemory ​

Write DataFrame to an IPC (Arrow/Feather) format in memory.

fsharp
member WriteIpcMemory(
    ?compression: IpcCompression,
    ?compatLevel: int,
    ?recordBatchSize: int,
    ?recordBatchStatistics: bool,
    ?maintainOrder: bool
) : byte[]

Parameters

NameTypeDescription
compressionIpcCompression (optional)-
compatLevelint (optional)-
recordBatchSizeint (optional)-
recordBatchStatisticsbool (optional)-
maintainOrderbool (optional)-

Returns: A byte array containing the serialized IPC data.


WriteIpcPartitioned ​

Write DataFrame to a partitioned IPC (Arrow/Feather) file.

This uses the Lazy execution engine internally to support streaming and cloud storage.

fsharp
member WriteIpcPartitioned(
    path: string,
    partitionBy: Selector,
    ?includeKeys: bool,
    ?keysPreGrouped: bool,
    ?maxRowsPerFile: int,
    ?approxBytesPerFile: int64,
    ?compression: IpcCompression,
    ?compatLevel: int,
    ?recordBatchSize: int,
    ?recordBatchStatistics: bool,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstring-
partitionBySelector-
includeKeysbool (optional)-
keysPreGroupedbool (optional)-
maxRowsPerFileint (optional)-
approxBytesPerFileint64 (optional)-
compressionIpcCompression (optional)-
compatLevelint (optional)-
recordBatchSizeint (optional)-
recordBatchStatisticsbool (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
cloudOptionsCloudOptions (optional)-

WriteIpcStream ​

Write to Arrow IPC record batch stream.

fsharp
member WriteIpcStream(path: string, compression: IpcCompression option, compatLevel: int option) : unit

Parameters

NameTypeDescription
pathstringPath to the IPC stream file or a byte buffer
compressionIpcCompression optionCompression method. Defaults to None.
compatLevelint optionUse a specific compatibility level when exporting Polars’ internal data structures.

WriteIpcStreamMemory ​

Write to Arrow IPC record batch stream.

fsharp
member WriteIpcStreamMemory(compression: IpcCompression option, compatLevel: int option) : byte[]

Parameters

NameTypeDescription
compressionIpcCompression optionCompression method. Defaults to None.
compatLevelint optionUse a specific compatibility level when exporting Polars’ internal data structures.

WriteJson ​

Write DataFrame to a JSON file.

fsharp
member WriteJson(path: string, ?format: JsonFormat) : DataFrame

Parameters

NameTypeDescription
pathstring-
formatJsonFormat (optional)-

WriteNdJson ​

Write DataFrame to a NDJSON (JsonLines) file.

fsharp
member WriteNdJson(path: string) : DataFrame

Parameters

NameTypeDescription
pathstring-

WriteParquet ​

Write DataFrame to a Parquet file.

This uses the Lazy execution engine internally to support streaming, statistics, and cloud storage.

fsharp
member WriteParquet(
    path: string,
    ?compression: ParquetCompression,
    ?compressionLevel: int,
    ?statistics: bool,
    ?rowGroupSize: int,
    ?dataPageSize: int,
    ?compatLevel: int,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstring-
compressionParquetCompression (optional)-
compressionLevelint (optional)-
statisticsbool (optional)-
rowGroupSizeint (optional)-
dataPageSizeint (optional)-
compatLevelint (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
cloudOptionsCloudOptions (optional)-

WriteParquetMemory ​

Write DataFrame to a Parquet format in memory.

fsharp
member WriteParquetMemory(
    ?compression: ParquetCompression,
    ?compressionLevel: int,
    ?statistics: bool,
    ?rowGroupSize: int,
    ?dataPageSize: int,
    ?compatLevel: int,
    ?maintainOrder: bool
) : byte[]

Parameters

NameTypeDescription
compressionParquetCompression (optional)-
compressionLevelint (optional)-
statisticsbool (optional)-
rowGroupSizeint (optional)-
dataPageSizeint (optional)-
compatLevelint (optional)-
maintainOrderbool (optional)-

Returns: A byte array containing the serialized Parquet data.


WriteParquetPartitioned ​

Write DataFrame to a partitioned Parquet file.

This uses the Lazy execution engine internally to support streaming and cloud storage.

fsharp
member WriteParquetPartitioned(
    path: string,
    partitionBy: Selector,
    ?includeKeys: bool,
    ?keysPreGrouped: bool,
    ?maxRowsPerFile: int,
    ?approxBytesPerFile: int64,
    ?compression: ParquetCompression,
    ?compressionLevel: int,
    ?statistics: bool,
    ?rowGroupSize: int,
    ?dataPageSize: int,
    ?compatLevel: int,
    ?maintainOrder: bool,
    ?syncOnClose: SyncOnClose,
    ?mkdir: bool,
    ?cloudOptions: CloudOptions
) : DataFrame

Parameters

NameTypeDescription
pathstring-
partitionBySelector-
includeKeysbool (optional)-
keysPreGroupedbool (optional)-
maxRowsPerFileint (optional)-
approxBytesPerFileint64 (optional)-
compressionParquetCompression (optional)-
compressionLevelint (optional)-
statisticsbool (optional)-
rowGroupSizeint (optional)-
dataPageSizeint (optional)-
compatLevelint (optional)-
maintainOrderbool (optional)-
syncOnCloseSyncOnClose (optional)-
mkdirbool (optional)-
cloudOptionsCloudOptions (optional)-

WriteTo ​

Stream the DataFrame directly to a database or other IDataReader consumer.

Uses a producer-consumer pattern. This method blocks until the consumer finishes reading. Ideal for SqlBulkCopy.WriteToServer or NpgsqlBinaryImporter.

fsharp
member WriteTo(writerAction: Action<IDataReader>, ?bufferSize: int, ?typeOverrides: IDictionary<string, Type>) : unit

Parameters

NameTypeDescription
writerActionAction<IDataReader>Callback that receives an IDataReader.
bufferSizeint (optional)Max number of batches to buffer in memory (default: 5).
typeOverridesIDictionary<string, Type> (optional)Dictionary to force specific C# types for columns (optional).

WriteToAdbc ​

Zero-copy bulk ingest of the current DataFrame into an ADBC database (e.g., DuckDB, SQLite).

Zero-copy bulk ingest of the current DataFrame into an ADBC database table. Pure syntactic sugar: automatically manages the creation, configuration, and disposal of the underlying AdbcStatement.

fsharp
member WriteToAdbc(statement: AdbcStatement) : UpdateResult
member WriteToAdbc(connection: AdbcConnection, tableName: string, ?ingestMode: AdbcIngestMode) : UpdateResult

Parameters

NameTypeDescription
statementAdbcStatementAn AdbcStatement configured with ingest options (e.g., target table).
connectionAdbcConnectionThe active ADBC connection (e.g., DuckDB, SQLite).
tableNamestringThe name of the target table to ingest data into.
ingestModeAdbcIngestMode (optional)The ingestion mode. Defaults to Create.

Returns: The UpdateResult containing the number of rows affected.


Pipeline Module Functions (DataFrame.*) ​

DataFrame.agg ​

Aggregation clause for GroupBy.

fsharp
DataFrame.agg : aggs: seq<Expr> -> builder: GroupBy -> DataFrame

Parameters

NameTypeDescription
aggsseq<Expr>-
builderGroupBy-

DataFrame.asLazy ​

Convert the DataFrame to a LazyFrame.

fsharp
DataFrame.asLazy : df: DataFrame -> LazyFrame

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.collectSchema ​

Get the schema of the DataFrame.

fsharp
DataFrame.collectSchema : df: DataFrame -> PolarsSchema

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.columnNames ​

Get the column names of the DataFrame.

fsharp
DataFrame.columnNames : df: DataFrame -> string[]

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.concatDiagonal ​

Diagonally concat DataFrames

fsharp
DataFrame.concatDiagonal : dfs: seq<DataFrame> -> DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-

DataFrame.concatHorizontal ​

Horizontally concat DataFrames.

fsharp
DataFrame.concatHorizontal : dfs: seq<DataFrame> -> DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-

DataFrame.concatHorizontalNoCheck ​

Horizontally concat DataFrames (Allow duplicates).

fsharp
DataFrame.concatHorizontalNoCheck : dfs: seq<DataFrame> -> DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-

DataFrame.concatVertical ​

Vertically concat DataFrames (Standard concat).

fsharp
DataFrame.concatVertical : dfs: seq<DataFrame> -> DataFrame

Parameters

NameTypeDescription
dfsseq<DataFrame>-

DataFrame.drop ​

Drop columns from the DataFrame.

fsharp
DataFrame.drop : columns: 'a -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columns'a-
dfDataFrame-

DataFrame.dropNans ​

Drop NaN values from the DataFrame.

fsharp
DataFrame.dropNans : df: DataFrame -> DataFrame

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.dropNansOn ​

Drop NaN values from the DataFrame with a condition.

fsharp
DataFrame.dropNansOn : subset: 'a -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
subset'a-
dfDataFrame-

DataFrame.dropNulls ​

Drop null values from the DataFrame.

fsharp
DataFrame.dropNulls : df: DataFrame -> DataFrame

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.dropNullsOn ​

Drop null values from the DataFrame with specific subset.

fsharp
DataFrame.dropNullsOn : subset: 'a -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
subset'a-
dfDataFrame-

DataFrame.explode ​

Explode list-like columns into multiple rows.

fsharp
DataFrame.explode : columns: 'a -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columns'a-
dfDataFrame-

DataFrame.fillNan ​

Fill NaN values in all columns with a specified value.

fsharp
DataFrame.fillNan : fillValue: Expr -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
fillValueExpr-
dfDataFrame-

DataFrame.fillNull ​

Fill null values in all columns with a specified value.

fsharp
DataFrame.fillNull : fillValue: Expr -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
fillValueExpr-
dfDataFrame-

DataFrame.filter ​

Filter rows based on a boolean expression.

fsharp
DataFrame.filter : expr: Expr -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
exprExpr-
dfDataFrame-

DataFrame.filterAll ​

Filter frame rows by combining multiple predicates with logical AND.

fsharp
DataFrame.filterAll : predicates: seq<Expr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
predicatesseq<Expr>-
dfDataFrame-

DataFrame.fold ​

Applies a folding function across all columns of the DataFrame from left to right, using the first column as the seed.

fsharp
DataFrame.fold : folder: (Series -> (Series -> Series)) -> df: DataFrame -> Series

Parameters

NameTypeDescription
folder(Series -> (Series -> Series))-
dfDataFrame-

DataFrame.foldState ​

Applies a folding function across all columns of the DataFrame from left to right, threading an accumulator state.

fsharp
DataFrame.foldState : folder: ('State -> (Series -> 'State)) -> state: 'State -> df: DataFrame -> 'State

Parameters

NameTypeDescription
folder('State -> (Series -> 'State))-
state'State-
dfDataFrame-

DataFrame.groupBy ​

Group by keys and apply aggregations.

fsharp
DataFrame.groupBy : keys: seq<Expr> -> df: DataFrame -> GroupBy

Parameters

NameTypeDescription
keysseq<Expr>-
dfDataFrame-

DataFrame.having ​

Having clause for GroupBy.

fsharp
DataFrame.having : predicate: Expr -> builder: GroupBy -> GroupBy

Parameters

NameTypeDescription
predicateExpr-
builderGroupBy-

DataFrame.head ​

Get the first n rows of the DataFrame.

fsharp
DataFrame.head : n: int -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
nint-
dfDataFrame-

DataFrame.hstack ​

Horizontally stack columns to the DataFrame.

fsharp
DataFrame.hstack : columns: seq<Series> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columnsseq<Series>-
dfDataFrame-

DataFrame.iter2 ​

Pipeline combinator for DataFrame.Iter2: ('T1 -> 'T2 -> unit) -> DataFrame -> DataFrame -> unit.

fsharp
DataFrame.iter2 : action: ('T1 -> ('T2 -> unit)) -> df1: DataFrame -> df2: DataFrame -> unit

Parameters

NameTypeDescription
action('T1 -> ('T2 -> unit))-
df1DataFrame-
df2DataFrame-

DataFrame.iterRows ​

Pipeline combinator for DataFrame.IterRows: ('T -> unit) -> DataFrame -> unit.

fsharp
DataFrame.iterRows : action: ('T -> unit) -> df: DataFrame -> unit

Parameters

NameTypeDescription
action('T -> unit)-
dfDataFrame-

DataFrame.iterate ​

Repeatedly applies an update function to a DataFrame for n steps, returning the final materialized state.

fsharp
DataFrame.iterate : steps: int -> stepFn: (int -> (DataFrame -> DataFrame)) -> initial: DataFrame -> DataFrame

Parameters

NameTypeDescription
stepsint-
stepFn(int -> (DataFrame -> DataFrame))-
initialDataFrame-

DataFrame.iteri2 ​

Pipeline combinator for DataFrame.Iteri2: (int64 -> 'T1 -> 'T2 -> unit) -> DataFrame -> DataFrame -> unit.

fsharp
DataFrame.iteri2 : action: (int64 -> ('T1 -> ('T2 -> unit))) -> df1: DataFrame -> df2: DataFrame -> unit

Parameters

NameTypeDescription
action(int64 -> ('T1 -> ('T2 -> unit)))-
df1DataFrame-
df2DataFrame-

DataFrame.iteriRows ​

Pipeline combinator for DataFrame.IteriRows: (int64 -> 'T -> unit) -> DataFrame -> unit.

fsharp
DataFrame.iteriRows : action: (int64 -> ('T -> unit)) -> df: DataFrame -> unit

Parameters

NameTypeDescription
action(int64 -> ('T -> unit))-
dfDataFrame-

DataFrame.join ​

Perform a join between two DataFrames.

fsharp
DataFrame.join : other: DataFrame -> leftOn: seq<Expr> -> rightOn: seq<Expr> -> how: JoinType -> left: DataFrame -> DataFrame

Parameters

NameTypeDescription
otherDataFrame-
leftOnseq<Expr>-
rightOnseq<Expr>-
howJoinType-
leftDataFrame-

DataFrame.joinOn ​

Perform a join between two DataFrames on a common column.

fsharp
DataFrame.joinOn : other: DataFrame -> on: seq<Expr> -> how: JoinType -> left: DataFrame -> DataFrame

Parameters

NameTypeDescription
otherDataFrame-
onseq<Expr>-
howJoinType-
leftDataFrame-

DataFrame.map ​

Transforms each column in the DataFrame using a column-wise mapping function (Series -> Series).

fsharp
DataFrame.map : mapping: (Series -> Series) -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
mapping(Series -> Series)The function applied to each column Series.
dfDataFrame-

Returns: A new DataFrame composed of the transformed Series.


DataFrame.mapRows ​

Transforms DataFrame rows into a new DataFrame using a strongly-typed F# Record mapping function ('TIn -> 'TOut).

fsharp
DataFrame.mapRows : mapping: ('TIn -> 'TOut) -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
mapping('TIn -> 'TOut)The pure transformation function applied to each row.
dfDataFrame-

Returns: A new DataFrame materialized from the mapped output records.


DataFrame.melt ​

Alias for DataFrame.unpivot.

fsharp
DataFrame.melt : index: Selector -> on: Selector -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
indexSelector-
onSelector-
dfDataFrame-

DataFrame.meltNamed ​

Alias for DataFrame.unpivotNamed.

fsharp
DataFrame.meltNamed : index: Selector -> on: Selector -> variableName: string -> valueName: string -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
indexSelector-
onSelector-
variableNamestring-
valueNamestring-
dfDataFrame-

DataFrame.orderByAscending ​

Order By the DataFrame in ascending order.

fsharp
DataFrame.orderByAscending : columns: seq<IColumnExpr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columnsseq<IColumnExpr>-
dfDataFrame-

DataFrame.orderByDescending ​

Order By the DataFrame in descending order.

fsharp
DataFrame.orderByDescending : columns: seq<IColumnExpr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columnsseq<IColumnExpr>-
dfDataFrame-

DataFrame.partitionBy ​

Group by the given columns and return the groups as separate dataframes.

fsharp
DataFrame.partitionBy : columns: seq<string> -> df: DataFrame -> DataFrame[]

Parameters

NameTypeDescription
columnsseq<string>-
dfDataFrame-

DataFrame.partitionMap ​

Partitions the DataFrame using an F# Record key with default ordering preserved (maintainOrder = true). Automatically infers partition column names from 'Key record fields.

fsharp
DataFrame.partitionMap : df: DataFrame -> Map<'Key, DataFrame>

Parameters

NameTypeDescription
dfDataFrameThe source DataFrame.

Returns: An immutable F# Map of partition keys to partition DataFrames.


DataFrame.partitionMapBy ​

Partitions the DataFrame by explicitly specified column names into an F# Record key.

fsharp
DataFrame.partitionMapBy : byCols: seq<string> -> df: DataFrame -> Map<'Key, DataFrame>

Parameters

NameTypeDescription
byColsseq<string>Column names to partition by.
dfDataFrameThe source DataFrame.

DataFrame.partitionMapByWith ​

Partitions the DataFrame by explicitly specified column names with full control over ordering.

fsharp
DataFrame.partitionMapByWith : byCols: seq<string> -> maintainOrder: bool -> df: DataFrame -> Map<'Key, DataFrame>

Parameters

NameTypeDescription
byColsseq<string>-
maintainOrderbool-
dfDataFrame-

DataFrame.partitionMapWith ​

Partitions the DataFrame using an F# Record key with explicit maintainOrder configuration.

fsharp
DataFrame.partitionMapWith : maintainOrder: bool -> df: DataFrame -> Map<'Key, DataFrame>

Parameters

NameTypeDescription
maintainOrderboolEnsure consistent group ordering. Setting to false improves partitioning throughput.
dfDataFrameThe source DataFrame.

DataFrame.rename ​

Rename columns based on a mapping dictionary or key-value pairs.

fsharp
DataFrame.rename : mapping: seq<(string * string)> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
mappingseq<(string * string)>-
dfDataFrame-

DataFrame.reverse ​

Reverse the order of the DataFrame.

fsharp
DataFrame.reverse : df: DataFrame -> DataFrame

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.select ​

Select columns from the DataFrame.

fsharp
DataFrame.select : exprs: seq<'a> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
exprsseq<'a>-
dfDataFrame-

DataFrame.show ​

Print the DataFrame to Console (Table format).

fsharp
DataFrame.show : df: DataFrame -> DataFrame

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.slice ​

Slice rows starting at offset with length.

fsharp
DataFrame.slice : offset: int64 -> length: uint64 -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
offsetint64-
lengthuint64-
dfDataFrame-

DataFrame.sortAscending ​

Sort (Order By) the DataFrame in ascending order.

fsharp
DataFrame.sortAscending : columns: seq<IColumnExpr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columnsseq<IColumnExpr>-
dfDataFrame-

DataFrame.sortDescending ​

Sort (Order By) the DataFrame in descending order.

fsharp
DataFrame.sortDescending : columns: seq<IColumnExpr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columnsseq<IColumnExpr>-
dfDataFrame-

DataFrame.tail ​

Get the last n rows of the DataFrame.

fsharp
DataFrame.tail : n: int -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
nint-
dfDataFrame-

DataFrame.toArrow ​

Convert the DataFrame to an Arrow RecordBatch.

fsharp
DataFrame.toArrow : df: DataFrame -> RecordBatch

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.toAsyncEnumerable ​

Streams in-memory DataFrame rows asynchronously.

fsharp
DataFrame.toAsyncEnumerable : chunkSize: int -> df: DataFrame -> IAsyncEnumerable<'T>

Parameters

NameTypeDescription
chunkSizeint-
dfDataFrame-

DataFrame.toMap ​

Convert the DataFrame to a map of column name to Series.

fsharp
DataFrame.toMap : df: DataFrame -> Map<string, Series>

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.toRecords ​

Convert the DataFrame to a sequence of records.

fsharp
DataFrame.toRecords : df: DataFrame -> seq<'T>

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.toRows ​

Returns a row enumerator for the DataFrame, allowing iteration over rows of type 'T.

fsharp
DataFrame.toRows : df: DataFrame -> RowEnumerator<'T>

Parameters

NameTypeDescription
dfDataFrameThe DataFrame to enumerate.

Returns: A row enumerator for the DataFrame.


DataFrame.toRowsAsync ​

Streams in-memory DataFrame rows asynchronously.

fsharp
DataFrame.toRowsAsync : chunkSize: int -> df: DataFrame -> IAsyncEnumerable<'T>

Parameters

NameTypeDescription
chunkSizeint-
dfDataFrame-

DataFrame.toStruct ​

Convert the DataFrame to a sequence of structs.

fsharp
DataFrame.toStruct : name: string -> df: DataFrame -> Series

Parameters

NameTypeDescription
namestring-
dfDataFrame-

DataFrame.unique ​

Return unique rows from the DataFrame.

fsharp
DataFrame.unique : df: DataFrame -> DataFrame

Parameters

NameTypeDescription
dfDataFrame-

DataFrame.uniqueOn ​

Drop duplicate rows based on specific subset expression(s), keeping the first occurrence.

fsharp
DataFrame.uniqueOn : subset: seq<Expr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
subsetseq<Expr>-
dfDataFrame-

DataFrame.uniqueWith ​

Drop duplicate rows based on subset with a specified keep strategy (First, Last, None, Any).

fsharp
DataFrame.uniqueWith : subset: seq<Expr> -> keep: UniqueKeepStrategy -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
subsetseq<Expr>-
keepUniqueKeepStrategy-
dfDataFrame-

DataFrame.unnestColumns ​

Decompose multiple struct columns.

fsharp
DataFrame.unnestColumns : columns: seq<string> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
columnsseq<string>-
dfDataFrame-

DataFrame.unpivot ​

Unpivot (Melt) the DataFrame from wide to long format using Selectors. Default column names ("variable", "value") will be used.

fsharp
DataFrame.unpivot : index: Selector -> on: Selector -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
indexSelector-
onSelector-
dfDataFrame-

DataFrame.unpivotNamed ​

Unpivot (Melt) the DataFrame using Selectors with custom variable and value column names.

fsharp
DataFrame.unpivotNamed : index: Selector -> on: Selector -> variableName: string -> valueName: string -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
indexSelector-
onSelector-
variableNamestring-
valueNamestring-
dfDataFrame-

DataFrame.vstack ​

Vertically stack another DataFrame to this one.

fsharp
DataFrame.vstack : other: DataFrame -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
otherDataFrame-
dfDataFrame-

DataFrame.withColumn ​

Add or replace a single column in the DataFrame.

fsharp
DataFrame.withColumn : expr: Expr -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
exprExpr-
dfDataFrame-

DataFrame.withColumns ​

Add or replace multiple columns in the DataFrame.

fsharp
DataFrame.withColumns : exprs: seq<Expr> -> df: DataFrame -> DataFrame

Parameters

NameTypeDescription
exprsseq<Expr>-
dfDataFrame-

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