NumPy Logic functions: iscomplexobj() function
numpy.iscomplexobj() function
The iscomplexobj() function is used to check for a complex type or an array of complex numbers.
The type of the input is checked, not the value. Even if the input has an imaginary part equal to zero, iscomplexobj evaluates to True.
Syntax:
numpy.iscomplexobj(x)
Version: 1.15.0
Parameter:
Name | Description | Required / Optional |
---|---|---|
x | The input can be of any type and shape. any |
Required |
Returns:
iscomplexobj : bool - The return value, True if x is of a complex type or has at least one complex element.
NumPy.iscomplexobj() method Example-1:
>>> import numpy as np
>>> np.iscomplexobj(3)
Output:
False
NumPy.iscomplexobj() method Example-2:
>>> import numpy as np
>>> np.iscomplexobj(3+0j)
Output:
True
NumPy.iscomplexobj() method Example-3:
>>> import numpy as np
>>> np.iscomplexobj([5, 3+0j, True])
Output:
True
Python - NumPy Code Editor:
Previous: iscomplex() function
Next: isfortran() function
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework