how many nan in array python


Here is what the above code is Doing:
1. We’re using the ~ operator to invert the logical expression.
2. We’re using the np.isnan function to check if the data is NaN.
3. We’re using the np.count_nonzero function to count the number of non-NaN values.