// can"t use indices > data length with reduceat`
trunc = np.searchsorted(indptr, indptr[-1])
min_or_max.reduceat(mat.data, indptr[:trunc], out=out[:trunc])
nnz = np.diff(indptr)
// compare to 0 in non-full rows
mask = nnz < N
out[mask] = min_or_max(out[mask], zero)
// reduceat will have filled empty rows with another data entry
out[nnz == 0] = zero
After Change
mat = self.tocsc() if axis == 0 else self.tocsr()
mat.sum_duplicates()
major_index, value = mat._minor_reduce(min_or_max)
min_or_max(value, 0, out=value)
out = np.zeros(len(mat.indptr) - 1, dtype=self.dtype)