def count_categories(self, level=0):
        # TODO: refactor this not to set an attribute. Why would we do this?
        self.counts = np.bincount(self.labels[level])
Sets the attribute counts to equal the bincount of the (integer-valued)
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tools/grouputils.py/Grouping.count_categories