[Numpy-discussion] storage for records

Stefan van der Walt stefan at sun.ac.za
Fri Feb 17 07:24:01 CST 2006


I am probably trying to do something silly, but still:

In [1]: import numpy as N

In [2]: N.__version__
Out[2]: '0.9.6.2127'

In [3]: P = N.array(N.zeros((2,2)), N.dtype((('f4',3), {'names': ['x','y','z'], 'formats': ['f4','f4','f4']})))
*** glibc detected *** malloc(): memory corruption: 0x0830bb48 ***
Aborted

Regards
Stéfan

On Thu, Feb 16, 2006 at 02:06:15PM -0700, Travis Oliphant wrote:
> Stefan van der Walt wrote:
> 
> >Is there any way to control the underlying storage for a record?
> >
> >I am trying to use Travis' earlier example of an image with named fields:
> >
> >dt = N.dtype('<f12', [('r','<f4'),('g','<f4'),('b','<f4')])
> >img = N.array(N.empty((rows,columns)), dtype=dt)




More information about the Numpy-discussion mailing list