This is documentation for an old release of SciPy (version 0.10.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_like of ints, optional
index : scalar or array_like, optional
|
---|---|
Returns : | output : list
|
See also
mean, median
Examples
>>> input = [0,1,2,3]
>>> labels = [1,1,2,2]
>>> sum(input, labels, index=[1,2])
[1.0, 5.0]