modin.pandas.Series.nunique¶
- Series.nunique(dropna=True)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.23.0/../../../../../opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/modin/pandas/series.py#L2212-L2216)¶
- Return number of unique elements in the series. - Excludes NA values by default. Snowpark pandas API does not distinguish between different NaN types like None, pd.NA, and np.nan, and treats them as the same. - Parameters:
- dropna (bool, default True) – Don’t include NaN in the count. 
- Return type:
- int 
 - Examples - >>> import numpy as np >>> s = pd.Series([1, 3, 5, 7, 7]) >>> s 0 1 1 3 2 5 3 7 4 7 dtype: int64 - >>> s.nunique() 4 - >>> s = pd.Series([pd.NaT, np.nan, pd.NA, None, 1]) >>> s.nunique() 1 - >>> s.nunique(dropna=False) 2