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.
array : [array_like]Input array or object whose elements, we need to test.
True, if the input array has a complex element; otherwise False
Code 1 :
Input array : [1, 3, 5, 4] Is complex : False
Code 2 :
Is complex : False class 'complex' Is complex : False Is complex : True
- Python | Index of Non-Zero elements in Python list
- Important differences between Python 2.x and Python 3.x with examples
- Python | Merge Python key values to list
- Reading Python File-Like Objects from C | Python
- Python | Convert list to Python array
- Python | Add Logging to a Python Script
- Python | Sort Python Dictionaries by Key or Value
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Add Logging to Python Libraries
- Python | Visualizing O(n) using Python
- bin() in Python
- Use of min() and max() in Python
- Python Set | pop()
- Any & All in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.