'Remove zero elements in-place.'

def eliminate_zeros(self):

    (R, C) = self.blocksize
    (M, N) = self.shape
    mask = (self.data != 0).reshape((-1), (R * C)).sum(axis=1)
    nonzero_blocks = mask.nonzero()[0]
    if (len(nonzero_blocks) == 0):
        return
    self.data[:len(nonzero_blocks)] = self.data[nonzero_blocks]
    _sparsetools.csr_eliminate_zeros((M // R), (N // C), self.indptr, self.indices, mask)
    self.prune()
