COO objects support a number of reductions. However, not all important
reductions are currently implemented (help welcome!) All of the following
x.sum(axis=1) np.max(x) np.min(x, axis=(0, 2)) x.prod()
If you are performing multiple reductions along the same axes, it may
be beneficial to call
This method can take an arbitrary
numpy.ufunc and performs a
reduction using that method. For example, the following will perform
sparse currently performs reductions by grouping together all
coordinates along the supplied axes and reducing those. Then, if the
number in a group is deficient, it reduces an extra time with zero.
As a result, if reductions can change by adding multiple zeros to
it, this method won’t be accurate. However, it works in most cases.