polars.datatypes.List#

class polars.datatypes.List(inner: PolarsDataType | PythonDataType)[source]#

Variable length list type.

Parameters:
inner

The DataType of the values within each list.

Examples

>>> df = pl.DataFrame(
...     {
...         "integer_lists": [[1, 2], [3, 4]],
...         "float_lists": [[1.0, 2.0], [3.0, 4.0]],
...     }
... )
>>> df
shape: (2, 2)
┌───────────────┬─────────────┐
│ integer_lists ┆ float_lists │
│ ---           ┆ ---         │
│ list[i64]     ┆ list[f64]   │
╞═══════════════╪═════════════╡
│ [1, 2]        ┆ [1.0, 2.0]  │
│ [3, 4]        ┆ [3.0, 4.0]  │
└───────────────┴─────────────┘
__init__(inner: PolarsDataType | PythonDataType)[source]#

Methods

__init__(inner)

base_type()

Return this DataType's fundamental/root type class.

is_(other)

Check if this DataType is the same as another DataType.

is_decimal()

Check whether the data type is a decimal type.

is_float()

Check whether the data type is a floating point type.

is_integer()

Check whether the data type is an integer type.

is_nested()

Check whether the data type is a nested 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.

Attributes

inner