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"]
code: def __eq__(self, other):
      # Scalar other.
      if isscalarlike(other):
          if np.isnan(other):
              return self.__class__(self.shape, dtype=np.bool_)
  
          if other == 0:
              warn(
                  "Comparing a sparse matrix with 0 using == is inefficient"
                  ", try using != instead.",
                  SparseEfficiencyWarning,
                  stacklevel=3,
              )
              all_true = self.__class__(
                  np.ones(self.shape, dtype=np.bool_)
              )
              inv = self._scalar_binopt(other, operator.ne)
              return all_true - inv
          else:
              return self._scalar_binopt(other, operator.eq)
      # Dense other.
      elif isdense(other):
          return self.todense() == other
      # Sparse other.
      elif isspmatrix(other):
          warn(
              "Comparing sparse matrices using == is inefficient, try using"
              " != instead.",
              SparseEfficiencyWarning,
              stacklevel=3,
          )
          # TODO sparse broadcasting
          if self.shape != other.shape:
              return False
          elif self.format != other.format:
              other = other.asformat(self.format)
          res = self._binopt(other, "_ne_")
          all_true = self.__class__(np.ones(self.shape, dtype=np.bool_))
          return all_true - res
      else:
          return False
  
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 6 for calling the _cs_matrix obj's underlying member method code with example usage: obj.__eq__(other) and returns: self, unknown, self, unknown, unknown, False, False