bug ? in Records arrays in numarray
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi, I have two record arrays. I was trying to assign one item from one recarray to the other:
I can't track down why one (q) contains scalars and the other (w) constains arrays (is array([428]) a 'rank-0 array'? ) ! This is how I generate them: main.ring4ext = rec.RecArray(main._extHdrRingBuffer, "i4,i4,i4,f4,f4,f4", shape=(ts,nc), names=("num","min","max","time","mean","darkVal"), aligned=1) omx.zext = rec.array(formats="i4,i4,i4,f4,f4,f4", names=("num","min","max","time","mean","darkVal"),shape=tuple(shapeZ),aligned=1 ) [[BTW: (shapeZ is a list, if I say: ...,shape=shapeZ I get NameError, "Illegal shape %s" % `shape` from "records.py" in line 462 -- usually type(shape) == types.ListType should be OK, right ?) ]] Any ideas? Thanks, Sebastian Haase
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
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 ??
Any comments are appreciated, Thanks Sebastian On Monday 28 June 2004 05:00 pm, Sebastian Haase wrote:
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Tue, 2004-06-29 at 17:52, Sebastian Haase wrote:
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. Regards, Todd
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
On Tuesday 29 June 2004 04:49 pm, Todd Miller wrote:
Thanks, but it actually seems to work well now, as long as I use myRecArray[i][j] instead of myRecArray[i,j]. So, it looks like there is not missing much. I'll keep your "official statement" in mind when I explore this further... Thanks again, Sebastian Haase
![](https://secure.gravatar.com/avatar/ad21d909c0ffcff2c377c7ee67aba291.jpg?s=120&d=mm&r=g)
At 7:49 PM -0400 2004-06-29, Todd Miller wrote:
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
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
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 ??
Any comments are appreciated, Thanks Sebastian On Monday 28 June 2004 05:00 pm, Sebastian Haase wrote:
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Tue, 2004-06-29 at 17:52, Sebastian Haase wrote:
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. Regards, Todd
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
On Tuesday 29 June 2004 04:49 pm, Todd Miller wrote:
Thanks, but it actually seems to work well now, as long as I use myRecArray[i][j] instead of myRecArray[i,j]. So, it looks like there is not missing much. I'll keep your "official statement" in mind when I explore this further... Thanks again, Sebastian Haase
![](https://secure.gravatar.com/avatar/ad21d909c0ffcff2c377c7ee67aba291.jpg?s=120&d=mm&r=g)
At 7:49 PM -0400 2004-06-29, Todd Miller wrote:
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
participants (4)
-
Perry Greenfield
-
Russell E Owen
-
Sebastian Haase
-
Todd Miller