On 19/08/11 15:49, Chris Withers wrote:
> On 18/08/2011 07:58, Bob Dowling wrote:
>>
>> >>> numpy.add.accumulate(a)
>> array([ 0, 1, 3, 6, 10])
>>
>> >>> numpy.add.accumulate(a, out=a)
>> array([ 0, 1, 3, 6, 10])
>
> What's the difference between numpy.cumsum and numpy.add.accumulate?
I think the
On 18/08/2011 07:58, Bob Dowling wrote:
>
> >>> numpy.add.accumulate(a)
> array([ 0, 1, 3, 6, 10])
>
> >>> numpy.add.accumulate(a, out=a)
> array([ 0, 1, 3, 6, 10])
What's the difference between numpy.cumsum and numpy.add.accumulate?
Where can I find the reference docs for these?
che
On 18/08/11 15:19, Chris Withers wrote:
> Hopefully a simple newbie question, if I have an array such as :
>
> array([0, 1, 2, 3, 4])
>
> ...what's the best way to cummulatively sum it so that I end up with:
>
> array([0, 1, 3, 6, 10])
>
> How would I do this both in-place and to create a new arr
On Thu, Aug 18, 2011 at 10:19 AM, Chris Withers wrote:
> Hi All,
>
> Hopefully a simple newbie question, if I have an array such as :
>
> array([0, 1, 2, 3, 4])
>
> ...what's the best way to cummulatively sum it so that I end up with:
>
> array([0, 1, 3, 6, 10])
>
> How would I do this both in-pla
Hi All,
Hopefully a simple newbie question, if I have an array such as :
array([0, 1, 2, 3, 4])
...what's the best way to cummulatively sum it so that I end up with:
array([0, 1, 3, 6, 10])
How would I do this both in-place and to create a new array?
cheers,
Chris
--
Simplistix - Content M
On Nov 16, 2009, at 12:16 AM, Robert Kern wrote:
> On Sun, Nov 15, 2009 at 23:11, Pierre GM wrote:
>> All,
>> An issue was recently raised about summing a MaskedArray with a np.object
>> dtype. Turns out that the problem is numpy based:
>> Let's sum using integers
> type(np.sum([1,2,3], dty
On Sun, Nov 15, 2009 at 23:11, Pierre GM wrote:
> All,
> An issue was recently raised about summing a MaskedArray with a np.object
> dtype. Turns out that the problem is numpy based:
> Let's sum using integers
type(np.sum([1,2,3], dtype=np.int32))
>
>
> Now, with a np.object dtype:
ty
All,
An issue was recently raised about summing a MaskedArray with a np.object
dtype. Turns out that the problem is numpy based:
Let's sum using integers
>>> type(np.sum([1,2,3], dtype=np.int32))
Now, with a np.object dtype:
>>> type(np.sum([1,2,3],dtype=object))
And we no longer have a np.o