polars.Series.unique#

Series.unique(*, maintain_order: bool = False) Series[source]#

Get unique elements in series.

Parameters:
maintain_order

Maintain order of data. This requires more work.

Examples

>>> s = pl.Series("a", [1, 2, 2, 3])
>>> s.unique().sort()
shape: (3,)
Series: 'a' [i64]
[
    1
    2
    3
]