Series.nunique(self, dropna=True)
[source]
Return number of unique elements in the object.
Excludes NA values by default.
Parameters: |
|
---|---|
Returns: |
|
See also
DataFrame.nunique
Series.count
>>> s = pd.Series([1, 3, 5, 7, 7]) >>> s 0 1 1 3 2 5 3 7 4 7 dtype: int64
>>> s.nunique() 4
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.Series.nunique.html