class_docstr: Mixin for min and max methods.
  These are not implemented for dia_matrix, hence the separate class.
class_docstr_tok: ["Mixin","for","min","and","max","methods",".","These","are","not","implemented","for","dia_matrix",",","hence","the","separate","class","."]
code: def _min_or_max_axis(self, axis, min_or_max, explicit):
      N = self.shape[axis]
      if N == 0:
          raise ValueError("zero-size array to reduction operation")
      M = self.shape[1 - axis]
  
      mat = self.tocsc() if axis == 0 else self.tocsr()
      mat.sum_duplicates()
  
      # Do the reduction
      value = mat._minor_reduce(min_or_max, axis, explicit)
      major_index = cupy.arange(M)
  
      mask = value != 0
      major_index = cupy.compress(mask, major_index)
      value = cupy.compress(mask, value)
  
      if axis == 0:
          return _coo.coo_matrix(
              (value, (cupy.zeros(len(value)), major_index)),
              dtype=self.dtype,
              shape=(1, M),
          )
      else:
          return _coo.coo_matrix(
              (value, (major_index, cupy.zeros(len(value)))),
              dtype=self.dtype,
              shape=(M, 1),
          )
  
imports: import cupy
  import numpy
  from cupy._core import internal
  from cupy import _util
  from cupyx.scipy.sparse import _base
  from cupyx.scipy.sparse import _coo
  from cupyx.scipy.sparse import _sputils
label_desc: Use image node_id 1 for calling the _minmax_mixin obj's underlying member method code with example usage: obj._min_or_max_axis(axis, min_or_max, explicit) and returns: _coo, _coo