[SciPy-user] incremental sum

Marek Wojciechowski mwojc at p.lodz.pl
Wed Feb 25 08:28:15 EST 2009


Pauli Virtanen wrote:

> Wed, 25 Feb 2009 13:04:51 +0100, Marek Wojciechowski wrote:
>> Is there in numpy/scipy a function/method which does efficiently:
>> 
>> for i in xrange(1, len(arr)):
>>    arr[i] += arr[i-1]
> 
> cumsum(arr, out=arr)

Thanks!

-- 
Marek Wojciechowski




More information about the SciPy-User mailing list