min_or_max(value, 0, out=value)
out = np.zeros(len(mat.indptr) - 1, dtype=self.dtype)
out[major_index] = value
out = np.asmatrix(out)
if axis == 1:
out = out.T
After Change
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)),