Perform a reverse cumulative sum on a numpy array

This does it:

np.cumsum(x[::-1])[::-1] 

Leave a Comment