Skip to content

PolarsSchema ​

Namespace: Polars.FSharp

Polars Schema definition (Name -> DataType).

Properties & Indexers ​

PropertyTypeDescription
Countint-
DataTypesDataType listGet all column datatypes
.[name: string]DataTypeIndexer: schema["col_name"]
Namesstring listGet all column names

Constructors & Static Methods ​

new ​

Create an empty schema

Create schema from field definitions

fsharp
new : unit -> PolarsSchema
new(fields: seq<Field>) : PolarsSchema
new(fields: seq<(string * DataType)>) : PolarsSchema

Parameters

NameTypeDescription
fieldsseq<Field> / seq<(string * DataType)>-

FromRecord ​

Create a Schema directly from a .NET type (e.g., a record or class).

fsharp
static member FromRecord : unit -> PolarsSchema

Returns: A PolarsSchema mapped from the type's properties.


ofList ​

fsharp
static member ofList(fields: (string * DataType) list) : PolarsSchema

Parameters

NameTypeDescription
fields(string * DataType) list-

ofMap ​

fsharp
static member ofMap(m: Map<string, DataType>) : PolarsSchema

Parameters

NameTypeDescription
mMap<string, DataType>-

Operators ​

op_Equality ​

fsharp
static member op_Equality(left: PolarsSchema, right: PolarsSchema) : bool

Parameters

NameTypeDescription
leftPolarsSchema-
rightPolarsSchema-

op_Inequality ​

fsharp
static member op_Inequality(left: PolarsSchema, right: PolarsSchema) : bool

Parameters

NameTypeDescription
leftPolarsSchema-
rightPolarsSchema-

Instance Methods ​

ContainsKey ​

fsharp
member ContainsKey(key: string) : bool

Parameters

NameTypeDescription
keystring-

GetFields ​

fsharp
member GetFields : unit -> seq<(string * DataType)>

Len ​

fsharp
member Len : unit -> uint64

ToDataFrame ​

Creates an empty DataFrame from this Schema.

fsharp
member ToDataFrame(?length: int64) : DataFrame

Parameters

NameTypeDescription
lengthint64 (optional)-

ToHtml ​

Generates a clean HTML table representation of the Schema for interactive environments.

fsharp
member ToHtml : unit -> string

Returns: An HTML formatted string representing the schema fields and types.


ToLazyFrame ​

Creates an empty LazyFrame from this Schema.

fsharp
member ToLazyFrame(?length: int64) : LazyFrame

Parameters

NameTypeDescription
lengthint64 (optional)-

ToList ​

Convert to F# ordered List of fields

fsharp
member ToList : unit -> (string * DataType) list

ToMap ​

Convert to F# Map (Warning: Does not preserve column order!)

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

TryGetValue ​

fsharp
member TryGetValue(key: string, value: byref<IPolarsDataType>) : bool

Parameters

NameTypeDescription
keystring-
valuebyref<IPolarsDataType>-

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