polars.Series.n_unique
-
Count the number of unique values in this Series.
nullis considered to be a unique value for the purposes of this operation.Examples
>>> s = pl.Series("a", [1, 2, 2, None]) >>> s.n_unique() 3
Series.n_unique() → int
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.n_unique.html