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.