On 02/24/2010 11:48 PM, Friedrich Romstedt wrote:
> 2010/2/25 Peter Shinners:
>
>> I want a function that works like cumsum, but starts at zero, instead of
>> starting with the first actual value.
>>
>> [...]
>>
>> tallies = np.cumsum(initial_array)
>> np.subtract(tallies, tallies[0], tallies)
2010/2/25 Peter Shinners :
> I want a function that works like cumsum, but starts at zero, instead of
> starting with the first actual value.
>
> [...]
>
> tallies = np.cumsum(initial_array)
> np.subtract(tallies, tallies[0], tallies)
Also note that this wouln't work as the example result [0, 3, 6
On Wed, Feb 24, 2010 at 23:03, Peter Shinners wrote:
> On 02/24/2010 09:00 PM, Robert Kern wrote:
>> On Wed, Feb 24, 2010 at 22:53, Peter Shinners wrote:
>>
>>> I want a function that works like cumsum, but starts at zero, instead of
>>> starting with the first actual value.
>>>
>>> For example;
On 02/24/2010 09:00 PM, Robert Kern wrote:
> On Wed, Feb 24, 2010 at 22:53, Peter Shinners wrote:
>
>> I want a function that works like cumsum, but starts at zero, instead of
>> starting with the first actual value.
>>
>> For example; I have an array with [4,3,3,1].
>> Cumsum will give me an
On Wed, Feb 24, 2010 at 22:53, Peter Shinners wrote:
> I want a function that works like cumsum, but starts at zero, instead of
> starting with the first actual value.
>
> For example; I have an array with [4,3,3,1].
> Cumsum will give me an array with [4,7,10,11].
> I want an array that is like [
I want a function that works like cumsum, but starts at zero, instead of
starting with the first actual value.
For example; I have an array with [4,3,3,1].
Cumsum will give me an array with [4,7,10,11].
I want an array that is like [0,4,7,8].
It looks like I could indirectly do this:
tallies =