🗺️当前这篇博文地址:https://myoontyee.github.io/article/6682865e.html
⚠️警告:博客文章禁止一切形式的非授权非法转载!
⚠️Attention: All forms of unauthorized illegal reposts are prohibited !
创建时间:2022年4月9日11:37:06
最新更新:2022年4月9日11:43:20
核心思路:np.nan
or np.isnan()
输入:数值
输出:bool
值,true
或者false
分块
导入库
- 调用
numpy
库
1 | import numpy as np |
进行判别
- 如果
Num
是NaN
,返回true
1 | Num == np.nan |
- 当然,也可以用
np.isnan()
- 如果是,返回
true
- 注意
np.isnan()
无法处理小数
- 如果是,返回
1 | np.isnan(Num) |
整体代码
1 | # 导入库 |