float(\'nan\') results in Nan (not a number). But how do I check for it? Should be very easy, but I cannot find it.
float(\'nan\')
math.isnan(x)
Return True if x is a NaN (not a number), and False otherwise.
True
False
>>> import math >>> x = float('nan') >>> math.isnan(x) True