numpy/sum

Sum

Compute sum of array elements

numpy
math
aggregate

Command

np.sum(arr, axis)

Explanation

Adds up elements along an axis.

Examples

Total sum of elements

np.sum(arr)

Column-wise sum

np.sum(arr, axis=0)