已知数据集iris.data,在数据集中的20个随机位置插入np.nan值,选择没有任何nan值的行。
疑问:
一开始随机插入nan值的时候,是对整个iris数据集进行随机插入,可是到后面在选择没有任何nan值的行的时候,只能将数据集的类型从object改成float才能运行,不过这样就结果只有数字没有文本了;如果不改成float类型的话,就不能运行,会显示“
ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''”。
请问各位有相应的解决方法吗?非常感谢!