[Numpy-discussion] indexed arrays ignoring duplicates

2010-09-28 Thread Damien Morton
lets say i have arrays: a = array((1,2,3,4,5)) indices = array((1,1,1,1)) and i perform operation: a[indices] += 1 the result is array([1, 3, 3, 4, 5]) in other words, the duplicates inĀ indicesĀ are ignored if I wanted the duplicates not to be ignored, resulting in: array([1, 6, 3, 4, 5]) h

Re: [Numpy-discussion] Trying out datarray

2010-09-28 Thread John Salvatier
OK, that makes sense. Thanks guys! On Tue, Sep 28, 2010 at 5:43 PM, Fernando Perez wrote: > On Tue, Sep 28, 2010 at 11:19 AM, John Salvatier > wrote: > > My other question is whether datarray will be able to handle multiple > data > > types in the same object; i.e. does it have the functionality

Re: [Numpy-discussion] Trying out datarray

2010-09-28 Thread Fernando Perez
On Tue, Sep 28, 2010 at 11:19 AM, John Salvatier wrote: > My other question is whether datarray will be able to handle multiple data > types in the same object; i.e. does it have the functionality of recarrays > and R data.frames? > The actual array container is a normal numpy array, so its dtype

Re: [Numpy-discussion] Trying out datarray

2010-09-28 Thread Skipper Seabold
On Tue, Sep 28, 2010 at 2:19 PM, John Salvatier wrote: > I am not sure if this is the correct place for such questions, but here > goes: > > I am curious about datarray, but I haven't been able to get it to work. The > module datarray does not appear to have a class DataArray (or DatArray). So > I

[Numpy-discussion] Trying out datarray

2010-09-28 Thread John Salvatier
I am not sure if this is the correct place for such questions, but here goes: I am curious about datarray, but I haven't been able to get it to work. The module datarray does not appear to have a class DataArray (or DatArray). So I am confused how I am supposed to use it. Can anyone advise? My ot

[Numpy-discussion] can savetxt write arrays with ndim > 2 ?

2010-09-28 Thread Mark Bakker
Hello list, I tried to savetxt an array with ndim = 3, but I get an error: In [252]: savetxt('test.dat',a) /Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/numpy/lib/io.py in savetxt(fname, X, fmt, delimiter) 784 785 for row in X: --> 786 fh.write