Say I have a numpy 2D array:
>>> t
array([[-0.00880717, 0.02522217, -0.01014062],
[-0.00866732, 0.01737254, 0.05396272]])
Now using array slicing, I can quickly obtain all items in all rows starting from the column with index 1 and sum them up:
>>> t[:, 1:].sum()
0.08641680780899146
To verify manually, here is what happens:
>>> 0.02522217+0.01737254+-0.01014062+0.05396272
0.08641680999999998
Just to understand the numpy array operations better, is numpy first going over all rows and summing the items of the rows, or is it going down one column, and then down the next one?
80.