class_docstr: base matrix class for compressed row and column oriented matrices
class_docstr_tok: ["base","matrix","class","for","compressed","row","and","column","oriented","matrices"]
docstr: Remove empty space after all non-zero elements.
          
code: def prune(self):
      """Remove empty space after all non-zero elements."""
      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])
  
imports: from __future__ import division, print_function, absolute_import
  from warnings import warn
  import operator
  import numpy
  from scipy._lib.six import zip
  from scipy._lib._util import _prune_array
  from .base import spmatrix, isspmatrix, SparseEfficiencyWarning
  from .data import _data_matrix, _minmax_mixin
  from .dia import dia_matrix
  from .None import _sparsetools
  from .sputils import upcast, upcast_char, to_native, isdense, isshape, getdtype, isscalarlike, IndexMixin, get_index_dtype, downcast_intp_index, get_sum_dtype, check_shape, matrix, asmatrix
label_desc: Use image node_id 44 for calling the _cs_matrix obj's underlying member method code with example usage: obj.prune() without return types