polars.Series.struct.drop#

Series.struct.drop(names: Sequence[str], *, strict: bool = True) Series[source]#

Drop one or more fields from the struct.

Parameters:
names

Names of the fields to drop.

strict

If True, raise an error if any of the specified fields do not exist in the struct.

Examples

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