def value_counts(self, dropna=False):
from pandas import Series, Index<EOL>if dropna:<EOL><INDENT>values = self[~self.isna()]._data<EOL><DEDENT>else:<EOL><INDENT>values = self._data<EOL><DEDENT>cls = type(self)<EOL>result = value_counts(values, sort=False, dropna=dropna)<EOL>index = Index(cls(result.index.view('<STR_LIT>'), dtype=self.dtype),<EOL>name=result.index.name)<EOL>return Series(result.values, index=index, name=result.name)<EOL>
Return a Series containing counts of unique values.

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

Returns
-------
Series