def value_counts(self, dropna=True):
from pandas import Index, Series<EOL>data = self._data[~self._mask]<EOL>value_counts = Index(data).value_counts()<EOL>array = value_counts.values<EOL>index = value_counts.index.astype(object)<EOL>if not dropna:<EOL><INDENT>array = np.append(array, [self._mask.sum()])<EOL>index = Index(np.concatenate(<EOL>[index.values,<EOL>np.array([np.nan], dtype=object)]), dtype=object)<EOL><DEDENT>return Series(array, index=index)<EOL>
Returns a Series containing counts of each category.

Every category will have an entry, even those with a count of 0.

Parameters
----------
dropna : boolean, default True
    Don't include counts of NaN.

Returns
-------
counts : Series

See Also
--------
Series.value_counts