1>>> a
2array([[1, 2, 3],
3 [4, 5, 6]])
4
5>>> np.cumsum(a,axis=0) # sum over rows for each of the 3 columns
6array([[1, 2, 3],
7 [5, 7, 9]])
8>>> np.cumsum(a,axis=1) # sum over columns for each of the 2 rows
9array([[ 1, 3, 6],
10 [ 4, 9, 15]])
11