July 6, 2010
1:56 p.m.
Hi, Is there a simple way to get a cumsum in reverse order? So far, the best I've come up with is to use fancy indexing twice to reverse things:
x = np.arange(10) np.cumsum(x[np.arange(9, -1, -1)])[np.arange(9, -1, -1)] array([45, 45, 44, 42, 39, 35, 30, 24, 17, 9])
If it matters, I only care about the 1-d case at this point. Thanks, Ken
5725
Age (days ago)
5725
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alan G Isaac -
Ken Basye