How can I check for the NaN value in Python?
There is a special literal "nan"
for the float
type:
>>> num = float('nan')
>>> num
nan
>>> import math
>>> math.isnan(num)
True
>>>
Reference:
How can I check for the NaN value in Python?
There is a special literal "nan"
for the float
type:
>>> num = float('nan')
>>> num
nan
>>> import math
>>> math.isnan(num)
True
>>>
Reference: