[SciPy-user] incremental sum

Marek Wojciechowski mwojc@p.lodz...
Wed Feb 25 07:28:15 CST 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