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):
      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()
  
      major_index, value = mat._minor_reduce(min_or_max)
      not_full = np.diff(mat.indptr)[major_index] < N
      value[not_full] = min_or_max(value[not_full], 0)
  
      mask = value != 0
      major_index = np.compress(mask, major_index)
      value = np.compress(mask, value)
  
      from . import coo_matrix
  
      if axis == 0:
          return coo_matrix(
              (value, (np.zeros(len(value)), major_index)),
              dtype=self.dtype,
              shape=(1, M),
          )
      else:
          return coo_matrix(
              (value, (major_index, np.zeros(len(value)))),
              dtype=self.dtype,
              shape=(M, 1),
          )
  
imports: import numpy
  from .base import spmatrix, _ufuncs_with_fixed_point_at_zero
  from .sputils import isscalarlike, validateaxis, matrix
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) and returns: coo_matrix, coo_matrix