zero = self.dtype.type(0)
out_mat = lil_matrix((1, len(mat.indptr) - 1), dtype=self.dtype)
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
After Change
zero = self.dtype.type(0)
out = np.zeros(len(indptr) - 1, dtype=self.dtype)
// 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