Skip to content

Commit

Permalink
DOC: update docstring for series.nunique (pandas-dev#25116)
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilialiao authored and Pingviinituutti committed Feb 28, 2019
1 parent 11e4e64 commit 24773bd
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,12 +1323,31 @@ def nunique(self, dropna=True):
Parameters
----------
dropna : boolean, default True
dropna : bool, default True
Don't include NaN in the count.
Returns
-------
nunique : int
int
See Also
--------
DataFrame.nunique: Method nunique for DataFrame.
Series.count: Count non-NA/null observations in the Series.
Examples
--------
>>> s = pd.Series([1, 3, 5, 7, 7])
>>> s
0 1
1 3
2 5
3 7
4 7
dtype: int64
>>> s.nunique()
4
"""
uniqs = self.unique()
n = len(uniqs)
Expand Down

0 comments on commit 24773bd

Please sign in to comment.