Python | numpy.issubdtype() function
Last Updated :
14 Mar, 2019
numpy.issubdtype()
function is used to determine whether the first argument is a typecode lower/equal in type hierarchy from second argument.If the first argument is lower or equal it returns true, otherwise it returns false.
Syntax : numpy.issubdtype(arg1, arg2)
Parameters :
arg1, arg2 : [dtype_like] dtype or string representing a typecode.
Return : [bool] Boolean result.
Code #1 :
import numpy as geek
arg1 = geek.int64
arg2 = geek.int32
out_val = geek.issubdtype(arg1, arg2)
print ( "Is the first argument lower: " , out_val)
|
Output :
Is the first argument lower: False
Code #2 :
import numpy as geek
arg1 = 'S2'
arg2 = geek.string_
out_val = geek.issubdtype(arg1, arg2)
print ( "Is the first argument lower: " , out_val)
|
Output :
Is the first argument lower: True
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...