在python中,NaN属于float类型,对float类型判空如下:
import math
from numpy import nan as NaN
a = NaN
print type(a) # 打印输出NaN的类型
print math.isnan(a)
执行结果:
<type 'float'>
True
在python中,NaN属于float类型,对float类型判空如下:
import math
from numpy import nan as NaN
a = NaN
print type(a) # 打印输出NaN的类型
print math.isnan(a)
执行结果:
<type 'float'>
True