[Numpy-discussion] parsing dtype descriptors

Valentin Haenel valentin at haenel.co
Fri Jul 4 04:53:09 EDT 2014


Dear Ted,

* Ted Sandler <ted.sandler at gmail.com> [2014-07-03]:
> 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.  This stackoverflow post is worth looking
> at:
> 
> 
> http://stackoverflow.com/questions/13997087/what-are-the-available-datatypes-for-dtype-with-numpys-loadtxt-an-genfromtxt

The only thing I could find in this direction, was:

http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html

But since you have mentioned the stackoverflow post, I presume you have
already discovered this page.

best,

V-



More information about the NumPy-Discussion mailing list