Previous topic

std

Next topic

tan

This Page

sum

mipylib.numeric.minum.sum(x, axis=None)

Sum of array elements over a given axis.

Parameters:
  • x – (array_like or list) Input values.
  • axis – (int) Axis along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array.

returns: (array_like) Sum result

Examples

>>> a = array([[0, 1], [0, 5]])
>>> sum(a)
6.0
>>> sum(a, axis=0)
array([0.0, 6.0])
>>> sum(a, axis=1)
array([1.0, 5.0])