Expr.Struct (StructOps)
Namespace: Polars.FSharp
Properties & Indexers
| Property | Type | Description |
|---|---|---|
.[index: int] / .[name: string] / .[names: string[]] | Expr | Access the fields of the struct by index. Access the fields of the struct by name. Access the fields of the struct by multiple names. |
Instance Methods
Drop
Drop one or more fields from the struct.
fsharp
member Drop(names: seq<string>, ?strict: bool) : ExprParameters
| Name | Type | Description |
|---|---|---|
names | seq<string> | Names of the fields to drop. |
strict | bool (optional) | If True, raise an error if any of the specified fields do not exist in the struct. |
Field
Retrieve a field from the struct by name.
Retrieve a field by its index.
fsharp
member Field([<ParamArray>] names: string[]) : Expr
member Field(index: int) : ExprParameters
| Name | Type | Description |
|---|---|---|
names | string[] | - |
index | int | - |
JsonEncode
Convert the struct column into a JSON string column. Useful for debugging or exporting to systems that support JSON strings.
fsharp
member JsonEncode : unit -> ExprRenameFields
Rename the fields of the struct.
fsharp
member RenameFields([<ParamArray>] names: string[]) : ExprParameters
| Name | Type | Description |
|---|---|---|
names | string[] | The new names for the fields. |
Unnest
Expand the struct into its individual fields.Alias for Expr.Struct.field("*").
fsharp
member Unnest : unit -> ExprWithFields
Add or overwrite fields of this struct.This is similar to with_columns on DataFrame.
fsharp
member WithFields([<ParamArray>] fields: Expr[]) : ExprParameters
| Name | Type | Description |
|---|---|---|
fields | Expr[] | - |