查找空值
在上一个练习中,您已经观察到两种 NULL 数据类型 None 和 numpy 的非数字对象 np.nan 在算术与逻辑运算中的表现。在本练习中,您将通过比较这两种类型来进一步理解它们的行为。numpy 包已作为 np 导入。
本练习是课程的一部分
在 Python 中处理缺失数据
交互式实操练习
通过完成这段示例代码来试试这个练习。
try:
# Print the comparison of two 'None's
print("'None' comparison output: ", ___)
except TypeError:
# Print if error
print("'None' does not support this operation!!")