def value_counts(self, normalize=False, sort=True, ascending=False,
                     bins=None, dropna=True):
        from pandas.core.algorithms import value_counts
        from pandas.tseries.api import DatetimeIndex, PeriodIndex
        result = value_counts(self, sort=sort, ascending=ascending,
                              normalize=normalize, bins=bins, dropna=dropna)

        if isinstance(self, PeriodIndex):
            # preserve freq
            result.index = self._simple_new(result.index.values,
                                            freq=self.freq)
        elif isinstance(self, DatetimeIndex):
            result.index = self._simple_new(result.index.values,
                                            tz=getattr(self, 'tz', None))
        return result
Returns object containing counts of unique values.
dataset/ETHPy150Open pydata/pandas/pandas/core/base.py/IndexOpsMixin.value_counts