def dummy(self, drop_idx=None, sparse=False, dtype=int):
        uni = self.uni
        if drop_idx is not None:
            idx = lrange(len(uni))
            del idx[drop_idx]
            uni = uni[idx]

        group = self.group

        if not sparse:
            return (group[:, None] == uni[None, :]).astype(dtype)
        else:
            return dummy_sparse(self.group_int)
drop_idx is only available if sparse=False
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tools/grouputils.py/Group.dummy