polars.Struct#

class polars.Struct(*args: Any, **kwargs: Any)[source]#

Struct composite type.

__init__(fields: Sequence[Field] | SchemaDict)[source]#

Struct composite type.

Parameters:
fields

The sequence of fields that make up the struct

Examples

>>> s = pl.Series(
...     "struct_series",
...     [{"a": [1], "b": [2], "c": [3]}, {"a": [4], "b": [5], "c": [6]}],
... )
>>> s
shape: (2,)
Series: 'struct_series' [struct[3]]
[
        {[1],[2],[3]}
        {[4],[5],[6]}
]

Methods

__init__(fields)

Struct composite type.

base_type()

Return this DataType's fundamental/root type class.

is_(other)

Check if this DataType is the same as another DataType.

is_float()

Check whether the data type is a temporal type.

is_integer()

Check whether the data type is an integer type.

is_not(other)

Check if this DataType is NOT the same as another DataType.

is_numeric()

Check whether the data type is a numeric type.

is_signed_integer()

Check whether the data type is a signed integer type.

is_temporal()

Check whether the data type is a temporal type.

is_unsigned_integer()

Check whether the data type is an unsigned integer type.

to_schema()

Return Struct dtype as a schema dict.

Attributes

is_nested