Python | numpy.issubdtype () function

NumPy | Python Methods and Functions

numpy.issubdtype() is used to determine if the first argument is type-type less / equal in the type hierarchy than the second argument. If the first argument is less than 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:

# Python program explaining
# numpy.issubdtype () function

  
# numpy import

import numpy as geek

 
# argument selection

 

arg1 = geek.int64

arg2 = geek.int32

 
# output boolean

out_val = geek.issubdtype (arg1, arg2)

print ( "Is the first argument lower:" , out_val) 

Output:

 Is the first argument lower: False 

Code # 2:

Output: < / strong>

 Is the first argument lower: True 




Get Solution for free from DataCamp guru

# Python program explaining
# numpy.issubdtype () function

< code class = "undefined spaces">  
# numpy import

import numpy as geek

 
# choice argument

 

arg1 = ` S2`

arg2 = geek.string_

 
# output boolean

out_val = geek.issubdtype (arg1, arg2)

print ( "Is the first argument lower:" , out_val)