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: Returns a matrix with the same sparsity structure as self,
  but with different data.  By default the structure arrays
  (i.e. .indptr and .indices) are copied.
code: def _with_data(self, data, copy=True):
      """Returns a matrix with the same sparsity structure as self,
      but with different data.  By default the structure arrays
      (i.e. .indptr and .indices) are copied.
      """
      if copy:
          return self.__class__(
              (data, self.indices.copy(), self.indptr.copy()),
              shape=self.shape,
              dtype=data.dtype,
          )
      else:
          return self.__class__(
              (data, self.indices, self.indptr),
              shape=self.shape,
              dtype=data.dtype,
          )
  
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 46 for calling the _cs_matrix obj's underlying member method code with example usage: obj._with_data(data, copy) and returns: self, self