From: Albert S. <fu...@gm...> - 2006-09-15 15:53:14
|
Hello all In [1]: import numpy as N In [3]: N.dtype({'names' : ['x', 'y'], 'formats' : [N.intc, N.float64]}, align=True) Out[3]: dtype([('x', '<i4'), ('', '|V4'), ('y', '<f8')]) The reason you might not have discovered this: In [2]: N.dtype? Type: type Base Class: <type 'type'> String Form: <type 'numpy.dtype'> Namespace: Interactive File: c:\python24\lib\site-packages\numpy\__init__.py Docstring: <no docstring> Cheers, Albert > -----Original Message----- > From: num...@li... [mailto:numpy- > dis...@li...] On Behalf Of Martin Wiechert > Sent: 15 September 2006 16:14 > To: numpy-discussion > Subject: [Numpy-discussion] PyArray_DescrConverter - alignment / > trailingunused bytes > > Hi list, > > I'm using PyArray_DescrConverter with a dict object to create a "struct- > like" > dtype from C. > As the struct contains different data types I run into "unaligned access" > problems. > Is there a way to force alignment or to get trailing unused bytes in the > dtpye? > > Thanks, Martin |