def nunique(self, dropna=True):
uniqs = self.unique()<EOL>n = len(uniqs)<EOL>if dropna and isna(uniqs).any():<EOL><INDENT>n -= <NUM_LIT:1><EOL><DEDENT>return n<EOL>
Return number of unique elements in the object.

Excludes NA values by default.

Parameters
----------
dropna : bool, default True
    Don't include NaN in the count.

Returns
-------
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