polars.datatypes.Array
-
Fixed length list type.
- Parameters:
-
- inner
-
The
DataTypeof the values within each array. - shape
-
The shape of the arrays.
- width
-
The length of the arrays.
Deprecated since version 0.20.31: The
widthparameter forArrayis deprecated. Useshapeinstead.
Examples
>>> s = pl.Series("a", [[1, 2], [4, 3]], dtype=pl.Array(pl.Int64, 2)) >>> s shape: (2,) Series: 'a' [array[i64, 2]] [ [1, 2] [4, 3] ]__init__( inner: PolarsDataType | PythonDataType, shape: int | tuple[int, ...] | None = None, *, width: int | None = None, ) → NoneMethods
__init__(inner[, shape, width])base_type()Return this DataType's fundamental/root type class.
from_python(py_type)Return the Polars data type corresponding to a given Python type.
is_(other)Check if this DataType is the same as another DataType.
is_decimal()Check whether the data type is a decimal type.
is_extension()Check whether the data type is an extension 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_numeric()Check whether the data type is a numeric type.
is_object()Check whether the data type is an object 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_dtype_expr()Return a
DataTypeExprwith a staticDataType.to_python()Return the Python type corresponding to this Polars data type.
Attributes
widthThe size of the Array.
innersizeshape
class polars.datatypes.Array(
inner: PolarsDataType | PythonDataType,
shape: int | tuple[int,
...] | None = None,
*,
width: int | None = None,
)
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/api/polars.datatypes.Array.html