Write a NumPy program to test element-wise for NaN of a given array
import numpy as np a = np.array([1, 0, np.nan, np.inf]) print("Original array") print(a) print("Test element-wise for NaN:") print(np.isnan(a))
Sample Output:
Original array [ 1. 0. nan inf] Test element-wise for NaN: [False False True False]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer