Python | numpy.issubsctype() function

numpy.issubsctype() function is used to determine whether the first argumentis a subclass of the second argument.If the first argument is a subclass of the second argument it returns true, otherwise it returns false.

Syntax : numpy.issubsctype(arg1, arg2)

Parameters :
arg1, arg2 : dtype or dtype specifier.



Return : [bool] Boolean result.

Code #1 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.issubsctype() function
  
# importing numpy
import numpy as geek
  
# selecting the argument
  
arg1 = geek.array([1.0, 2.5, 3.9])
arg2 = geek.int
  
# output boolean value
out_val = geek.issubsctype(arg1, arg2)
print ("Is the first argument subclass of the second argument: ", out_val) 

chevron_right


Output :

Is the first argument subclass of the second argument:  False

 

Code #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.issubsctype() function
  
# importing numpy
import numpy as geek
  
# selecting the argument
  
arg1 = geek.array([1.0, 2.5, 3.9])
arg2 = geek.float
  
# output boolean value
out_val = geek.issubsctype(arg1, arg2)
print ("Is the first argument subclass of the second argument: ", out_val) 

chevron_right


Output :

Is the first argument subclass of the second argument:  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.