polars.Expr.arr.explode#

Expr.arr.explode() Expr[source]#

Returns a column with a separate row for every list element.

Returns:
Exploded column with the datatype of the list elements.

Examples

>>> df = pl.DataFrame({"a": [[1, 2, 3], [4, 5, 6]]})
>>> df.select(pl.col("a").arr.explode())
shape: (6, 1)
┌─────┐
│ a   │
│ --- │
│ i64 │
╞═════╡
│ 1   │
│ 2   │
│ 3   │
│ 4   │
│ 5   │
│ 6   │
└─────┘