[ Web Proxy ]
URL:
Viewing: https://numpy.org/doc/stable/reference/generated/../random/../c-api/../generated/numpy.isdtype.html [Back]  [Original]

numpy.isdtype — NumPy v2.5 Manual
Back to top
Search the docs ...:

numpy.isdtype#

numpy.isdtype(dtype, kind)[source]#

Determine if a provided dtype is of a specified data type kind.

This function only supports built-in NumPys data types. Third-party dtypes are not yet supported.

Parameters:
dtypedtype

The input dtype.

kinddtype 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:
outbool

See also

issubdtype

Examples

Try it in your browser!
>>> import numpy as np
>>> np.isdtype(np.float32, np.float64)
False
>>> np.isdtype(np.float32, "real floating")
True
>>> np.isdtype(np.complex128, ("real floating", "complex floating"))
True

Web Proxy Viewer  |  New URL  |  Original Page