polars.Expr.arr.join#

Expr.arr.join(separator: str) Expr[source]#

Join all string items in a sublist and place a separator between them.

This errors if inner type of list != Utf8.

Parameters:
separator

string to separate the items with

Returns:
Series of dtype Utf8

Examples

>>> df = pl.DataFrame({"s": [["a", "b", "c"], ["x", "y"]]})
>>> df.select(pl.col("s").arr.join(" "))
shape: (2, 1)
┌───────┐
│ s     │
│ ---   │
│ str   │
╞═══════╡
│ a b c │
├╌╌╌╌╌╌╌┤
│ x y   │
└───────┘