row = out_mat.rows[0]
data = out_mat.data[0]
for i, (start, stop) in enumerate(izip(mat.indptr, mat.indptr[1:])):
if start == stop:
continue
val = min_or_max(mat.data[start:stop])
After Change
// 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)
min_or_max(out, zero, where=nnz < N, out=out)
out[nnz == 0] = zero
out = lil_matrix(out, dtype=self.dtype)