1import numpy as np
2# Let a be some 2d array; here we just use dummy data
3# to illustrate the method
4a = np.ones((10,5))
5# Multiply just the 2nd column by 5.2 in-place
6a[:,1] *= 5.2
7
8# Now get the cumulative sum of just that column
9csum = np.cumsum(a[:,1])
10