Q:

Write a NumPy program to find the missing data in a given array

0

Write a NumPy program to find the missing data in a given array

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np 
 
nums = np.array([[3, 2, np.nan, 1],
              [10, 12, 10, 9],
              [5, np.nan, 1, np.nan]])

print("Original array:") 
print(nums)
print("\nFind the missing data of the said array:")
print(np.isnan(nums))
Sample Output:
Original array:
[[ 3.  2. nan  1.]
 [10. 12. 10.  9.]
 [ 5. nan  1. nan]]

Find the missing data of the said array:
[[False False  True False]
 [False False False False]
 [False  True False  True]]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now