numpy.dtype.isbuiltin#
attribute
- dtype.isbuiltin#
Integer indicating how this dtype relates to the built-in dtypes.
Read-only.
0
if this is a structured array type, with fields
1
if this is a dtype compiled into numpy (such as ints, floats etc)
2
if the dtype is for a user-defined numpy type A user-defined type uses the numpy C-API machinery to extend numpy to handle a new array type. See User-defined data-types in the NumPy manual.
Examples
>>> import numpy as np >>> dt = np.dtype(np.int16) >>> dt.isbuiltin 1 >>> dt = np.dtype(np.float64) >>> dt.isbuiltin 1 >>> dt = np.dtype([('field1', np.float64)]) >>> dt.isbuiltin 0