def value_counts(self, dropna=True):
from pandas import Index, Series<EOL>keys, counts = algos._value_counts_arraylike(self.sp_values,<EOL>dropna=dropna)<EOL>fcounts = self.sp_index.ngaps<EOL>if fcounts > <NUM_LIT:0>:<EOL><INDENT>if self._null_fill_value and dropna:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if self._null_fill_value:<EOL><INDENT>mask = isna(keys)<EOL><DEDENT>else:<EOL><INDENT>mask = keys == self.fill_value<EOL><DEDENT>if mask.any():<EOL><INDENT>counts[mask] += fcounts<EOL><DEDENT>else:<EOL><INDENT>keys = np.insert(keys, <NUM_LIT:0>, self.fill_value)<EOL>counts = np.insert(counts, <NUM_LIT:0>, fcounts)<EOL><DEDENT><DEDENT><DEDENT>if not isinstance(keys, ABCIndexClass):<EOL><INDENT>keys = Index(keys)<EOL><DEDENT>result = Series(counts, index=keys)<EOL>return result<EOL>
Returns a Series containing counts of unique values.

Parameters
----------
dropna : boolean, default True
    Don't include counts of NaN, even if NaN is in sp_values.

Returns
-------
counts : Series