Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: update docstring for series.nunique #25116

Merged
merged 2 commits into from
Feb 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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