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()
or compare the number to itself. NaN is always != NaN, otherwise (e.g. if it is a number) the comparison should succeed.