How to check for NaN in python?
Question: `float('nan')` results in a thingy simply called nan. But how do I check for
it? Should be very easy, but i cannot find it.


Answer: [math.isnan()](http://docs.python.org/library/math.html#math.isnan)

> Checks if the float x is a NaN (not a number). NaNs are part of the IEEE 754
> standards. Operation like but not limited to inf * 0, inf / inf or any
> operation involving a NaN, e.g. nan * 1, return a NaN.
>
> _New in version 2.6._
    
    
    >>> import math
    >>> x=float('nan')
    >>> math.isnan(x)
    True
    >>>
    

