polars.Series.map.get#

Series.map.get(key: IntoExpr) → Series[source]#

Look up key in every map.

Maps that do not hold key yield null, as do null maps. Use contains_key() to tell a missing key apart from a key whose value is null.

engine:In MemoryStreamingDistributed
Parameters:
key

Key to look up. A single value is broadcast over all maps.

Returns:
Series

Series of the map’s value type.

Examples

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