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\')
With python < 2.6 I ended up with
def isNaN(x): return str(float(x)).lower() == 'nan'
This works for me with python 2.5.1 on a Solaris 5.9 box and with python 2.6.5 on Ubuntu 10