NumPy Logic functions: isreal() function
numpy.isreal() function
The isreal() function is used to test a bool array, where True if input element is real.
If element has complex type with zero complex part, the return value for that element is True.
Syntax:
numpy.isreal(x)
Version: 1.15.0
Parameter:
Name | Description | Required / Optional |
---|---|---|
x | Input array. array_like |
Required |
Returns:
out : ndarray, bool - Boolean array of same shape as x.
NumPy.isreal() method Example:
>>> import numpy as np
>>> np.isreal([2+1j, 2+0j, 5.5, 4, 2, 3j])
Output:
array([False, True, True, True, True, False])
Python - NumPy Code Editor:
Previous: isfortran() function
Next: isrealobj() 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