pymel.util.arrays.sum

sum(a, start=0, axis=None)

sum(a[, start=0[, axis=(axis0, axis1, ...)]]) –> numeric or Array

Returns the sum of all the components of a, an iterable of values that support the add operator, plus start. If a is an Array and axis are specified will return an Array of sum(x) for x in a.axisiter(*axis)

>>> A = Array([[1,2,3],[4,5,6]])
>>> print A.formated()
[[1, 2, 3],
 [4, 5, 6]]
>>> sum(A)
21
>>> sum(A, axis=(0, 1))
21
>>> sum(A, axis=0)
Array([5, 7, 9])
>>> sum(A, axis=1)
Array([6, 15])

Previous topic

pymel.util.arrays.sqrt

Next topic

pymel.util.arrays.tan

Core

Core Modules

Other Modules

This Page