This is documentation for an old release of SciPy (version 0.9.0). Read this page in the documentation of the latest stable release (version 1.15.1).
Calculate the sum of the values of the array.
Parameters : | input : array_like
labels : array of integers, same shape as input
index : scalar or array
|
---|---|
Returns : | output : list
|
See also
Examples
>>> input = [0,1,2,3]
>>> labels = [1,1,2,2]
>>> sum(input, labels, index=[1,2])
[1.0, 5.0]