[Numpy-discussion] returning recarray records as plain arrays

Stefan van der Walt stefan at sun.ac.za
Fri Jan 5 03:56:21 CST 2007


On Thu, Jan 04, 2007 at 01:40:54AM -0500, Pierre GM wrote:
> On Wednesday 03 January 2007 23:57, Matthew Koichi Grimes wrote:
> > Pierre GM wrote:
> > > On Wednesday 03 January 2007 15:39, Matthew Koichi Grimes wrote:
> > >> As per Stefan's help, I've made a subclass of recarray called nnvalue.
> > >> It just fixes the dtype to [('x', 'f8'), ('dx', 'f8'), ('delta', 'f8)],
> > >> and adds a few member functions. I basically treat nnvalue as a struct
> > >> with three equal-shaped array fields: x, dx, and delta.
> 
> Matthew,
> It seems that declaring your default dtype as a class argument and naming it 
> dtype is the reason why things are messed up: you're basically overwriting 
> the original ndarray.dtype

Oops, unintended side-effect there!

Cheers
Stéfan


More information about the Numpy-discussion mailing list