Fw: [Numpy-discussion] numarray.records - get/set item
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
My situation where I got onto this, is having one field named 'mmm' ("MinMaxMean") being an 3 element array. Now, to assign the values first I tried: self.hdrArray = makeHdrArray(self.h) #this makes the record array self.hdr = self.hdrArray[0].field #this is my shortcut to the bound member function # it essentially is a solution (hack) for the getitem part # but regarding setitem I had to learn that "assigning to a function" is illigal in Python - as opposed to C++ #so to do assignment I need to do: self.hdr('mmm')[0], self.hdr('mmm')[1], self.hdr('mmm')[2] = (mi,ma,av) now that I'm looking at it, self.hdrArray[0].setfield('mmm', (mi,ma,av)) would probably be better... How about adding an attribute 'f' which could serve as a "proxy" to allow: myRec.f.mmm = (mi,ma,av) and maybe even additionally: myRec.f['mmm'] = (mi,ma,av) Regards, Sebastian ----- Original Message ----- From: "Perry Greenfield" <perry@stsci.edu> To: "Sebastian Haase" <haase@msg.ucsf.edu>; <numpy-discussion@lists.sourceforge.net> Sent: Thursday, December 04, 2003 3:08 PM Subject: RE: [Numpy-discussion] numarray.records - get/set item
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi everybody, I would like to check if there has been made a decision on this ? I'm planning to use record arrays to access image data header-information and having an attribute 'f' like suggested is still my favorite way. Is anyone besides me using record arrays on memory-mapped buffers ? Thanks, Sebastian Haase ----- Original Message ----- From: "Sebastian Haase" <haase@msg.ucsf.edu> To: <numpy-discussion@lists.sourceforge.net> Sent: Thursday, December 04, 2003 4:27 PM Subject: Fw: [Numpy-discussion] numarray.records - get/set item
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi everybody, I would like to check if there has been made a decision on this ? I'm planning to use record arrays to access image data header-information and having an attribute 'f' like suggested is still my favorite way. Is anyone besides me using record arrays on memory-mapped buffers ? Thanks, Sebastian Haase ----- Original Message ----- From: "Sebastian Haase" <haase@msg.ucsf.edu> To: <numpy-discussion@lists.sourceforge.net> Sent: Thursday, December 04, 2003 4:27 PM Subject: Fw: [Numpy-discussion] numarray.records - get/set item
participants (1)
-
Sebastian Haase