polars.Series.map.entries#

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

Convert the Map to a List of Struct entries.

Each entry is a Struct with a key and a value field. Entry order is preserved. The inverse of Expr.list.to_map().

engine:In MemoryStreamingDistributed

Examples

>>> s = pl.Series([{"a": 1, "b": 2}], dtype=pl.Map(pl.String, pl.Int64))
>>> s.map.entries()
shape: (1,)
Series: '' [list[struct[2]]]
[
        [{"a",1}, {"b",2}]
]