polars.Expr.arr.concat#

Expr.arr.concat(other: list[Expr | str] | Expr | str | Series | list[Any]) Expr[source]#

Concat the arrays in a Series dtype List in linear time.

Parameters:
other

Columns to concat into a List Series

Examples

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