numpy.isnan()

numpy.isnan

numpy.isnan(x[, out]) =

Test element-wise for NaN and return result as a boolean array.

Parameters:

x : array_like

Input array.

Returns:

y : ndarray or bool

For scalar input, the result is a new boolean with value True if the input is NaN; otherwise the value is False.

For array input, the result is a boolean array of the same dimensions as the input and the values are True if the corresponding element of the input is NaN; otherwise the values are False.