adding an attribute to an nd-array

Pierre GM pgmdevlist at
Sat Oct 28 04:14:14 CDT 2006

On Friday 27 October 2006 18:37, Albert Strasheim wrote:
> Hello all
> I would like to create an "info" array like this to attach some metadata,
> mostly sampling frequency, to some of my arrays.
> I browsed through the NumPy book and looked at the __new__ and
> __array_finalize__ stuff in Pierre GM's new MaskedArray, but I'm still
> thoroughly confused about how to create a simple array+metadata subclass
> that Just Works(TM).
> Does anybody have some code that they would be willing to share?

I'm not sure about the JustWorks(R)(TM), but I just created a page on the Wiki 
describing a simple example of InfoArray class
That should do what you want, but let me know if you have some more specific 
I guess I should go more into the details of subclassing on that page, but I'm 
quite far from being a specialist...

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

More information about the Numpy-discussion mailing list