def dummy_sparse(self, level=0):
        from scipy import sparse
        groups = self.labels[level]
        indptr = np.arange(len(groups)+1)
        data = np.ones(len(groups), dtype=np.int8)
        self._dummies = sparse.csr_matrix((data, groups, indptr))
create a sparse indicator from a group array with integer labels
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tools/grouputils.py/Grouping.dummy_sparse