NumPy

Previous topic

numpy.dtype.char

Next topic

numpy.dtype.str

This is documentation for an old release of NumPy (version 1.18). Read this page in the documentation of the latest stable release (version 2.2).

numpy.dtype.num

attribute

dtype.num

A unique number for each of the 21 different built-in types.

These are roughly ordered from least-to-most precision.

Examples

>>>
>>> dt = np.dtype(str)
>>> dt.num
19
>>>
>>> dt = np.dtype(float)
>>> dt.num
12