polars.Expr.list.concat#

Expr.list.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").list.concat("b"))
shape: (2, 1)
┌─────────────────┐
│ a               │
│ ---             │
│ list[str]       │
╞═════════════════╡
│ ["a", "b", "c"] │
│ ["x", "y", "z"] │
└─────────────────┘