Re: [Numpy-discussion] PyArray_DescrConverter - alignment / trailingunused bytes

2006-09-15 Thread Albert Strasheim
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

Re: [Numpy-discussion] PyArray_DescrConverter - alignment / trailingunused bytes

2006-09-15 Thread Martin Wiechert
On Friday 15 September 2006 17:53, Albert Strasheim wrote: 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

Re: [Numpy-discussion] PyArray_DescrConverter - alignment / trailingunused bytes

2006-09-15 Thread Albert Strasheim
Hello all -Original Message- From: [EMAIL PROTECTED] [mailto:numpy- [EMAIL PROTECTED] On Behalf Of Martin Wiechert Sent: 15 September 2006 19:53 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion]PyArray_DescrConverter - alignment / trailingunused bytes On Friday

Re: [Numpy-discussion] PyArray_DescrConverter - alignment/ trailingunused bytes

2006-09-15 Thread Albert Strasheim
Argh snip One final question. To me the repr of a dtype with gaps is a little bit puzzling: dtype ({'names': ['a', 'b', 'c'], 'formats': ['a4', 'f8', 'f4'], 'offsets': [0, 16, 24]}) dtype([('a', '|S4'), ('', '|V12'), ('b', 'f8'), ('', '|V12'), ('c', 'f4')]) There should be

Re: [Numpy-discussion] PyArray_DescrConverter - alignment / trailingunused bytes

2006-09-15 Thread Travis Oliphant
Martin Wiechert wrote: On Friday 15 September 2006 19:14, Travis Oliphant wrote: Martin Wiechert wrote: Thanks Albert! Do you also know the corresponding C-API function? It cannot be PyArray_DescrConverter (PyObject *, PyArray_Descr **), whose signature has no align, right?

Re: [Numpy-discussion] PyArray_DescrConverter - alignment / trailingunused bytes

2006-09-15 Thread Martin Wiechert
On Friday 15 September 2006 20:27, Travis Oliphant wrote: Martin Wiechert wrote: On Friday 15 September 2006 19:14, Travis Oliphant wrote: Martin Wiechert wrote: Thanks Albert! Do you also know the corresponding C-API function? It cannot be PyArray_DescrConverter (PyObject *,