best cumulative sum
- From: "David Isaac" <aisaac0@xxxxxxxxxxx>
- Date: Mon, 21 Nov 2005 04:13:57 GMT
What's the good way to produce a cumulative sum?
E.g., given the list x,
cumx = x[:]
for i in range(1,len(x)):
cumx[i] = cumx[i]+cumx[i-1]
What's the better way?
Thanks,
Alan Isaac
.
- Follow-Ups:
- Re: best cumulative sum
- From: Gerard Flanagan
- Re: best cumulative sum
- From: Micah Elliott
- Re: best cumulative sum
- From: Robert Kern
- Re: best cumulative sum
- From: Steven D'Aprano
- Re: best cumulative sum
- Prev by Date: Re: about list
- Next by Date: Re: Aproximative string matching
- Previous by thread: How to install python2.4.2 on IRIX6.5 ?
- Next by thread: Re: best cumulative sum
- Index(es):