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]