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
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
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
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
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
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