PolarsSchema
Namespace: Polars.FSharp
Polars Schema definition (Name -> DataType).
Properties & Indexers
| Property | Type | Description |
|---|---|---|
Count | int | - |
DataTypes | DataType list | Get all column datatypes |
.[name: string] | DataType | Indexer: schema["col_name"] |
Names | string list | Get 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)>) : PolarsSchemaParameters
| Name | Type | Description |
|---|---|---|
fields | seq<Field> / seq<(string * DataType)> | - |
FromRecord
Create a Schema directly from a .NET type (e.g., a record or class).
fsharp
static member FromRecord : unit -> PolarsSchemaReturns: A PolarsSchema mapped from the type's properties.
ofList
fsharp
static member ofList(fields: (string * DataType) list) : PolarsSchemaParameters
| Name | Type | Description |
|---|---|---|
fields | (string * DataType) list | - |
ofMap
fsharp
static member ofMap(m: Map<string, DataType>) : PolarsSchemaParameters
| Name | Type | Description |
|---|---|---|
m | Map<string, DataType> | - |
Operators
op_Equality
fsharp
static member op_Equality(left: PolarsSchema, right: PolarsSchema) : boolParameters
| Name | Type | Description |
|---|---|---|
left | PolarsSchema | - |
right | PolarsSchema | - |
op_Inequality
fsharp
static member op_Inequality(left: PolarsSchema, right: PolarsSchema) : boolParameters
| Name | Type | Description |
|---|---|---|
left | PolarsSchema | - |
right | PolarsSchema | - |
Instance Methods
ContainsKey
fsharp
member ContainsKey(key: string) : boolParameters
| Name | Type | Description |
|---|---|---|
key | string | - |
GetFields
fsharp
member GetFields : unit -> seq<(string * DataType)>Len
fsharp
member Len : unit -> uint64ToDataFrame
Creates an empty DataFrame from this Schema.
fsharp
member ToDataFrame(?length: int64) : DataFrameParameters
| Name | Type | Description |
|---|---|---|
length | int64 (optional) | - |
ToHtml
Generates a clean HTML table representation of the Schema for interactive environments.
fsharp
member ToHtml : unit -> stringReturns: An HTML formatted string representing the schema fields and types.
ToLazyFrame
Creates an empty LazyFrame from this Schema.
fsharp
member ToLazyFrame(?length: int64) : LazyFrameParameters
| Name | Type | Description |
|---|---|---|
length | int64 (optional) | - |
ToList
Convert to F# ordered List of fields
fsharp
member ToList : unit -> (string * DataType) listToMap
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>) : boolParameters
| Name | Type | Description |
|---|---|---|
key | string | - |
value | byref<IPolarsDataType> | - |