[Numpy-discussion] parsing dtype descriptors

Ted Sandler ted.sandler at gmail.com
Sun Jul 6 18:47:47 EDT 2014


Thanks!


On Fri, Jul 4, 2014 at 1:53 AM, Robert Kern <robert.kern at gmail.com> wrote:

> On Thu, Jul 3, 2014 at 10:53 PM, Ted Sandler <ted.sandler at gmail.com>
> wrote:
> > Thanks. No, it's not what I'm looking for.
> >
> > I'm looking for the code that parses the string "<i8" in the npy file
> array
> > header's descriptor:
> >
> >   {'descr': '<i8', 'fortran_order': False, 'shape': (5,), }
> >
> > There are many different descriptor strings, e.g.:
> >
> >  '>f8'
> >  '=f4'
> >  'float32'
> >  '>c16'
> >  ...
> >
> > Ideally, I want the exhaustive list of valid input strings that describe
> > standard ndarrays (i.e. ndarrays with simple entries as opposed to
> records
> > or subarrays). Lacking an exhaustive list or spec, I'd like the source
> code
> > that does the parsing for them.
>
>
> https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/descriptor.c#L1321
>
> https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/conversion_utils.c#L1000
>
> https://github.com/numpy/numpy/blob/master/numpy/core/include/numpy/ndarraytypes.h#L97
>
> --
> Robert Kern
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140706/1bcb4665/attachment.html>


More information about the NumPy-Discussion mailing list