numpy.iscomplex() in Python Last Updated : 08 Mar, 2024 Comments Improve Suggest changes Like Article Like Report The numpy.iscomplex() function tests element-wise whether it is a complex number or not(not infinity or not Not a Number) and returns the result as a boolean array. Syntax : numpy.iscomplex(array) Parameters : array : [array_like] Input array whose element we want to test Return : boolean array containing the result Code 1 : Python # Python Program illustrating # numpy.iscomplex() method import numpy as geek print("Is Complex : ", geek.iscomplex([1+1j, 1+0j]), "\n") print("Is Complex : ", geek.iscomplex([0+1j, 0]), "\n") Output : Is Complex : [ True False] Is Complex : [ True False] Code 2 : Python # Python Program illustrating # numpy.iscomplex() method import numpy as geek # Returns True/False value for each element a = geek.arange(20).reshape(5, 4) print("Is complex : \n", geek.iscomplex(a)) # Returns True/False value as ans # because we have mentioned dtpe in the beginning b = geek.arange(20).reshape(5, 4).dtype = complex print("\n",b) print("\nIs complex : ", geek.iscomplex(b)) b = [[1j], [3]] print("\nIs complex : \n", geek.iscomplex(b)) Output : Is complex : [[False False False False] [False False False False] [False False False False] [False False False False] [False False False False]] Is complex : False Is complex : [[ True] [False]] Note : These codes won't run on online IDE's. So please, run them on your systems to explore the working. Comment More infoAdvertise with us Next Article numpy.iscomplex() in Python M Mohit Gupta_OMG Improve Article Tags : Python Python-numpy Python numpy-Logic Functions Practice Tags : python Similar Reads numpy.iscomplexobj() in Python numpy.iscomplexobj(array) : This logical function helps to checks for the complex type of an array or array of a complex number. Even if imaginary part is equal to zero, it is considered to be an Complex Object. Parameters : array : [array_like]Input array or object whose elements, we need to test. 1 min read numpy.isscalar() in Python In this article, we will elucidate the `numpy.isscalar()` function through a well-documented code example and comprehensive explanation. Python numpy.isscalar() Syntax Syntax : numpy.isscalar(element) Parameters: element: The input element to be checked for scalar properties.Return Type: bool: Retur 3 min read numpy.isreal() in Python numpy.isreal(array) : Test element-wise whether it is a real number or not(not infinity or not Not a Number) and return the result as a boolean array. Parameters : array : [array_like] Input array whose element we want to test Return : boolean array containing the result Code 1 : Python # Python Pro 1 min read numpy.isnan() in Python The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax : numpy.isnan(array [, out]) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array placed wit 2 min read numpy.isinf() in Python The numpy.isinf() function tests element-wise whether it is +ve or -ve infinity or not return the result as a boolean array. Syntax: numpy.isinf(array [, out]) Parameters :  array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array 2 min read numpy.isneginf() in Python The numpy.isneginf() function tests element-wise whether it is negative infinity or not, and returns the result as a boolean array. Syntax :  numpy.isneginf(array, y = None) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity. y : [array_like]A boole 2 min read numpy.isposinf() in Python The numpy.isposinf() function tests element-wise whether it is positive infinity or not and returns the result as a boolean array. Syntax : numpy.isposinf(array, y = None) Parameters:  array : [array_like]Input array or object whose elements, we need to test for infinity. y : [array_like]A boolea 2 min read numpy.isfinite() in Python The numpy.isfinite() function tests element-wise whether it is finite or not(not infinity or not Not a Number) and return the result as a boolean array. Syntax : numpy.isfinite(array [, out]) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity out : 2 min read numpy.isrealobj() in Python numpy.isrealobj(array) : This logical function helps to checks if the array has no complex type or array has a complex number. Even if imaginary part is equal to zero, it is not considered to be a Real Object. Parameters : array : [array_like]Input array or object whose elements, we need to test. Re 2 min read numpy.isfortran() in Python numpy.isfortran(array) : This is a logical function that checks whether array is Fortran contiguous or not. Order : [C-contiguous, F-contiguous, A-contiguous; optional] C-contiguous order in memory(last index varies the fastest). C order means that operating row-rise on the array will be slightly qu 2 min read Like