numpy.format_parser

class numpy.format_parser(formats, names, titles, aligned=False, byteorder=None)

Class to convert formats, names, titles description to a dtype

After constructing the format_parser object, the dtype attribute is
the converted data-type.

dtype = format_parser(formats, names, titles).dtype

Parameters:

formats : string or list

comma-separated format descriptions — ‘f8, i4, a5’ list of format description strings — [‘f8’, ‘i4’, ‘a5’]

names : string or (list or tuple of strings)

comma-separated field names — ‘col1, col2, col3’ list or tuple of field names

titles : sequence

sequence of title strings or unicode

aligned : bool

align the fields by padding as the C-compiler would

byteorder : :

If specified, all the fields will be changed to the provided byteorder. Otherwise, the default byteorder is used.

Returns:

object :

A Python object whose dtype attribute is a data-type.

Previous topic

numpy.dtype

Next topic

numpy.finfo

This Page

Quick search