perform a reverse cumulative sum on a numpy array,np.cumsum(x[::-1])[::-1]