bundles / numpy 2.4.3 / numpy / isdtype
function
numpy:isdtype
Signature
def isdtype ( dtype , kind ) Summary
Determine if a provided dtype is of a specified data type kind.
Extended Summary
This function only supports built-in NumPy's data types. Third-party dtypes are not yet supported.
Parameters
dtype: dtypeThe input dtype.
kind: dtype or str or tuple of dtypes/strs.dtype or dtype kind. Allowed dtype kinds are: *
'bool': boolean kind *'signed integer': signed integer data types *'unsigned integer': unsigned integer data types *'integral': integer data types *'real floating': real-valued floating-point data types *'complex floating': complex floating-point data types *'numeric': numeric data types
Returns
out: bool
Examples
import numpy as np np.isdtype(np.float32, np.float64) np.isdtype(np.float32, "real floating") np.isdtype(np.complex128, ("real floating", "complex floating"))✓
See also
- issubdtype
Aliases
-
numpy.isdtype