[SciPy-user] incremental sum

Pauli Virtanen pav@iki...
Wed Feb 25 06:17:07 CST 2009


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)



More information about the SciPy-user mailing list