python通用解法:
def isNaN(num):
return num != num
如果isNan函数返回True,即为是nan。
高票答案不推荐,因为需要强制转换float,如果type不为number就傻了
Ref:
https://stackoverflow.com/questions/944700/how-can-i-check-for-nan-in-python
python通用解法:
def isNaN(num):
return num != num
如果isNan函数返回True,即为是nan。
高票答案不推荐,因为需要强制转换float,如果type不为number就傻了
Ref:
https://stackoverflow.com/questions/944700/how-can-i-check-for-nan-in-python