[SciPy-user] incremental sum

Pauli Virtanen pav at iki.fi
Wed Feb 25 07:17:07 EST 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