Running total
Press Step to add the next cell
arr.sum() adds every element. Same idea as sum(list), but on a NumPy ndarray.
np.sum(a) folds the whole array into one number.
You have numbers in an array. Instead of total = 0 and a for-loop, call arr.sum() and NumPy returns the total.
Totals of sensor readings, pixel intensities, feature sums before normalization, batch loss aggregation.