polars.internals.expr.list.ExprListNameSpace.unique#

ExprListNameSpace.unique() Expr[source]#

Get the unique/distinct values in the list.

Examples

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