Data type classes (numpy.dtypes)#
This module is home to specific dtypes related functionality and their classes.
For more general information about dtypes, also see numpy.dtype and
Data type objects (dtype).
Similar to the builtin types module, this submodule defines types (classes)
that are not widely used directly.
Added in version NumPy: 1.25
The dtypes module is new in NumPy 1.25. Previously DType classes were only accessible indirectly.
DType classes#
The following are the classes of the corresponding NumPy dtype instances and
NumPy scalar types. The classes can be used in isinstance checks and can
also be instantiated or used directly. Direct use of these classes is not
typical, since their scalar counterparts (e.g. np.float64) or strings
like "float64" can be used.
Additionally, abstract DType classes such as IntegerAbstractDType mirror
the numeric part of the scalar type hierarchy. These cannot be instantiated
and are meant for isinstance/issubclass checks and as the kind
argument of numpy.isdtype.
Boolean#
Bit-sized integers#
C-named integers (may be aliases)#
Floating point#
Complex#
Strings and Bytestrings#
Times#
Others#
Abstract DTypes#
These classes cannot be instantiated. They mirror the numeric part of the
scalar type hierarchy and the concrete DType classes
above inherit from them, so that they can be used in isinstance and
issubclass checks as well as for the kind argument of numpy.isdtype.
Note that booleans are not considered numeric here.