polars.Config.set_auto_structify#

classmethod Config.set_auto_structify(active: bool | None = False) type[Config][source]#

Allow multi-output expressions to be automatically turned into Structs.

Examples

>>> df = pl.DataFrame({"v": [1, 2, 3], "v2": [4, 5, 6]})
>>> with pl.Config(set_auto_structify=True):
...     out = df.select(pl.all())
>>> out
shape: (3, 1)
┌───────────┐
│ v         │
│ ---       │
│ struct[2] │
╞═══════════╡
│ {1,4}     │
│ {2,5}     │
│ {3,6}     │
└───────────┘