Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update docstring for series.nunique
  • Loading branch information
cecilialiao committed Feb 3, 2019
commit 1e496d014b595edf93ae0d8e41627ae326d2724c
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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing spaces after commas (PEP-8)

>>> s
0 1
1 3
2 5
3 7
4 7
dtype: int64

>>> s.nunique()
4
"""
uniqs = self.unique()
n = len(uniqs)
Expand Down