'Remove empty space after all non-zero elements.'

def prune(self):

    major_dim = self._swap(self.shape)[0]
    if (len(self.indptr) != (major_dim + 1)):
        raise ValueError('index    pointer    has    invalid    length')
    if (len(self.indices) < self.nnz):
        raise ValueError('indices    array    has    fewer    than    nnz    elements')
    if (len(self.data) < self.nnz):
        raise ValueError('data    array    has    fewer    than    nnz    elements')
    self.indices = _prune_array(self.indices[:self.nnz])
    self.data = _prune_array(self.data[:self.nnz])
