[Numpy-discussion] bug ? in Records arrays in numarray

Russell E Owen rowen at u.washington.edu
Wed Jun 30 08:57:06 CDT 2004


At 7:49 PM -0400 2004-06-29, Todd Miller wrote:
>On Tue, 2004-06-29 at 17:52, Sebastian Haase wrote:
>>  OK,
>>  I'm still trying to get a handle on these record arrays - because 
>>I think they
>>  are pretty cool, if I could get them to work...
>>  Following the code from yesterday (see that posting below) I 
>>discovered this:
>>  main.ring4ext[0][0]   is not the same as   main.ring4ext[0,0]
>>  is this intended ??
>>
>>  >>> main.ring4ext[0][0]
>>  (2308, 76, 272, 1088481152.0, 104.18000030517578, 1994.949951171875)
>>  >>> main.ring4ext[0,0]
>>  (array([2308, 2309]), array([76, 76]), array([272, 269]), array([ 
>>1.08848115e
>>  +09,   1.08848115e+09], type=Float32), array([ 104.18000031,  104.45999908],
>>  type=Float32), array([ 1994.94995117,  1994.95996094], type=Float32))
>>  >>> main.ring4ext.shape    # yesterday I had this different !!! (20,1)
>>  (20, 2)
>>
>>  Any comments are appreciated,
>
>I talked to JC Hsu, the numarray.records author, and he explained that
>we're probably looking at a limitation of numarray.records: it doesn't
>yet handle multi-dimensional arrays of records.  JC indicated he had
>replied to Sebastian,  but for the benefit of everyone else, that's the
>deal.

I agree. I have gotten numarray.records to handle multi-dimensional 
arrays, but it's a terrible pain to create them, str(arry) fails and 
setting elements of records arrays is painful. I hope at some point 
they get a major redesign, as they don't actually seem to have been 
designed to fit in with numarray. The resulting code was so ugly that 
I gave up and used multiple identically shaped arrays instead.

-- Russell




More information about the Numpy-discussion mailing list