Skip to content

Expr.Struct (StructOps) ​

Namespace: Polars.FSharp

Properties & Indexers ​

PropertyTypeDescription
.[index: int] / .[name: string] / .[names: string[]]ExprAccess 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) : Expr

Parameters

NameTypeDescription
namesseq<string>Names of the fields to drop.
strictbool (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) : Expr

Parameters

NameTypeDescription
namesstring[]-
indexint-

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 -> Expr

RenameFields ​

Rename the fields of the struct.

fsharp
member RenameFields([<ParamArray>] names: string[]) : Expr

Parameters

NameTypeDescription
namesstring[]The new names for the fields.

Unnest ​

Expand the struct into its individual fields.Alias for Expr.Struct.field("*").

fsharp
member Unnest : unit -> Expr

WithFields ​

Add or overwrite fields of this struct.This is similar to with_columns on DataFrame.

fsharp
member WithFields([<ParamArray>] fields: Expr[]) : Expr

Parameters

NameTypeDescription
fieldsExpr[]-

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