polars.Expr.str.explode#

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

Returns a column with a separate row for every string character.

Returns:
Expr

Expression of data type String.

Examples

>>> df = pl.DataFrame({"a": ["foo", "bar"]})
>>> df.select(pl.col("a").str.explode())
shape: (6, 1)
┌─────┐
│ a   │
│ --- │
│ str │
╞═════╡
│ f   │
│ o   │
│ o   │
│ b   │
│ a   │
│ r   │
└─────┘