polars.Series.map.keys#

Series.map.keys() → Series[source]#

Get the keys of every map as a List, in entry order.

engine:In MemoryStreamingDistributed
Returns:
Series

Series of data type List of the map’s key type.

Examples

>>> s = pl.Series(
...     [{"a": 1, "b": 2}, {}, None], dtype=pl.Map(pl.String, pl.Int64)
... )
>>> s.map.keys()
shape: (3,)
Series: '' [list[str]]
[
        ["a", "b"]
        []
        null
]