NumPy | isnan method
Start your free 7-days trial now!
isnan(~) method checks whether or not each value in the input array is NaN (i.e. missing value).
The input array.
Numpy array |
Instead of creating a new array, you can place the computed mean into the array specified by
Values that are flagged as False will be ignored, that is, their original value will be uninitialized. If you specified the
out parameter, the behavior is slightly different - the original value will be kept intact.
a is a scalar, then a single boolean is returned. Otherwise, a Numpy array of booleans is returned.
np.isnan([0, 1, np.NaN, np.inf, np.NINF])array([False, False, True, False, False])