def consolidate(self, inplace=True):
        if not inplace:
            result = self.copy()
        else:
            result = self

        if result.is_consolidated:
            return result

        result._consolidate_inplace()
        return result
Internally consolidate chunks of data
dataset/ETHPy150Open pydata/pandas/pandas/sparse/list.py/SparseList.consolidate