Re: [Numpy-discussion] computing some running sums

2010-06-01 Thread Keith Goodman
On Tue, Jun 1, 2010 at 6:56 AM, Keith Goodman wrote: > On Tue, Jun 1, 2010 at 6:47 AM, Neal Becker wrote: >> Not sure what to call this. >> >> Any suggestion on computing the vector: >> >> sum(u[i*M:i*M+N]) for i in range (len(u)/M) > > How about a cumsum and then a loop to take the differences o

Re: [Numpy-discussion] computing some running sums

2010-06-01 Thread Keith Goodman
On Tue, Jun 1, 2010 at 6:47 AM, Neal Becker wrote: > Not sure what to call this. > > Any suggestion on computing the vector: > > sum(u[i*M:i*M+N]) for i in range (len(u)/M) How about a cumsum and then a loop to take the differences of the desired indices of the cumsum? Might be faster to convert

[Numpy-discussion] computing some running sums

2010-06-01 Thread Neal Becker
Not sure what to call this. Any suggestion on computing the vector: sum(u[i*M:i*M+N]) for i in range (len(u)/M) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion