I have a numpy array like
x=np.array([1,2,3,4])
I want to create another numpy array y which is the cumulative sum of x, so that
y = np.cumsum(x)
See http://docs.scipy.org/doc/numpy/reference/generated/numpy.cumsum.html