numpy.ndarray.trace
numpy.ndarray.cumsum
Return the sum of the array elements over the given axis.
Refer to numpy.sum for full documentation.
See also