polars.Expr.map.entries#
- Expr.map.entries() Expr[source]#
Convert the
Mapto aListofStructentries.Each entry is a
Structwith akeyand avaluefield. Entry order is preserved. The inverse ofExpr.list.to_map().Examples
>>> df = pl.DataFrame( ... {"m": pl.Series([{"a": 1, "b": 2}], dtype=pl.Map(pl.String, pl.Int64))} ... ) >>> df.select(pl.col("m").map.entries()) shape: (1, 1) ┌────────────────────┐ │ m │ │ --- │ │ list[struct[2]] │ ╞════════════════════╡ │ [{"a",1}, {"b",2}] │ └────────────────────┘