Overview:
- The function numpy.isnan()checks each element of a numpy array-like for the "not a number" property and returns True or False as the result. The results are returned as an ndarray containing Boolean values.
- When the input is a scalar the return type is a single Boolean value.
Example:
# Example Python program that checks # Try making nans # Create a numpy array and fill some of # Check the ndarray for nans |
Output:
Contents of the ndarray: [[nan nan] [inf 0.]] Results of nan check: [[ True True] [False False]] |