Python | numpy.issubdtype() function

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 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.issubdtype() function
  
# importing numpy
import numpy as geek
  
# selecting the argument
  
arg1 = geek.int64
arg2 = geek.int32
  
# output boolean value
out_val = geek.issubdtype(arg1, arg2)
print ("Is the first argument lower: ", out_val) 

chevron_right


Output :

Is the first argument lower:  False

 

Code #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.issubdtype() function
  
# importing numpy
import numpy as geek
  
# selecting the argument
  
arg1 ='S2'
arg2 = geek.string_
  
# output boolean value
out_val = geek.issubdtype(arg1, arg2)
print ("Is the first argument lower: ", out_val) 

chevron_right


Output :

Is the first argument lower:  True


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.