Python | numpy.issubdtype() function (original) (raw)
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
Similar Reads
- 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 spe 1 min read
- Python | numpy.issctype() function numpy.issctype() function is used to determine whether the given object represents a scalar data-type.If the given object represents a scalar data-type it returns true, otherwise it returns false. Syntax : numpy.issctype(rep) Parameters : rep : any input. Return : [bool] Boolean result of check whet 1 min read
- numpy.issubclass_() function – Python numpy.issubclass_() function is used to determine whether a class is a subclass of a second class. Syntax : numpy.issubclass_(arg1, arg2) Parameters : arg1 : [class] Input class. True is returned if arg1 is a subclass of arg2. arg2 : [class or tuple of classes] Input class. If a tuple of classes, Tr 1 min read
- numpy.mintypecode() function – Python numpy.mintypecode() function return the character for the minimum-size type to which given types can be safely cast. Syntax : numpy.mintypecode(typechars, typeset = 'GDFgdf', default = 'd') Parameters : typechars : [list of str or array_like] If a list of strings, each string should represent a dtyp 1 min read
- numpy.i0() function | Python numpy.i0() function is the modified Bessel function of the first kind, order 0. it's usually denoted by I0. Syntax : numpy.i0(x) Parameters : x : [array_like, dtype float or complex] Argument of the Bessel function. Return : [ndarray, shape = x.shape, dtype = x.dtype] The modified Bessel function ev 1 min read
- numpy.imag() function - Python numpy.imag() function return the imaginary part of the complex argument. Syntax : numpy.imag(arr) Parameters : arr : [array_like] Input array. Return : [ndarray or scalar] The imaginary component of the complex argument. If val is real, the type of val is used for the output. If val has complex elem 1 min read
- numpy.ma.is_masked() function | Python numpy.ma.is_masked() function determine whether input has masked values & accepts any object as input, but always returns False unless the input is a MaskedArray containing masked values. Syntax : numpy.ma.is_masked(arr) Parameters : arr : [array_like] Array to check for masked values. Return : 1 min read
- numpy.ma.is_mask() function | Python numpy.ma.is_mask() function return True if parameter m is a valid, standard mask. This function does not check the contents of the input, only that the type is MaskType. In particular, this function returns False if the mask has a flexible dtype. Syntax : numpy.ma.is_mask(m) Parameter : m : [array_l 1 min read
- numpy.iinfo() function – Python numpy.iinfo() function shows machine limits for integer types. Syntax : numpy.iinfo(dtype) Parameters : dtype : [integer type, dtype, or instance] The kind of integer data type to get information about. Return : Machine limits for integer types. Code #1 : # Python program explaining # numpy.iinfo() 1 min read
- numpy.pad() function in Python numpy.pad() function is used to pad the Numpy arrays. Sometimes there is a need to perform padding in Numpy arrays, then numPy.pad() function is used. The function returns the padded array of rank equal to the given array and the shape will increase according to pad_width. Syntax: numpy.pad(array, p 2 min read