w3resource

Numpy Data type: issubsctype() function

numpy.issubsctype() function

The issubsctype() function is used to determine if the first argument is a subclass of the second argument.

Version: 1.15.0

Syntax:

numpy.issubsctype(arg1, arg2)

Parameter:

Name Description Required /
Optional
arg1, arg2 : dtype or dtype specifier Data-types. Required

Return value:

out : bool - The result.

Example: numpy.issubsctype() function

>>> import numpy as np
>>> np.issubsctype('S4', str)
False
>>> np.issubsctype('S8', str)
False
>>> np.issubsctype(np.array([1]), int)
True
>>> np.issubsctype(np.array([1]), float)
False

Python Code Editor:

Previous: issubdtype()
Next: issubclass_()



Follow us on Facebook and Twitter for latest update.