is any nan in python code example Example: python3 is nan >>> import math >>> x = float('nan') >>> math.isnan(x) True