aba = abalone.loc[abalone['高度' < 0.4,:]]
dataPlot(aba)
代码想要把abalone数据集中高度大于等于0.4的数据剔除
却报错TypeError: '<' not supported between instances of 'str' and 'int'
浮点数不能用小于号比较,
但是代码原作者却能正常执行不报错,
求大神指点
...全文
1222打赏收藏
pyrhon中浮点数比较问题
python机器学习初学 aba = abalone.loc[abalone['高度' < 0.4,:]] dataPlot(aba) 代码想要把abalone数据集中高度大于等于0.4的数据剔除 却报错TypeError: '<' not supported between instances of 'str' and 'int' 浮点数不能用小于号比较, 但是代码原作者却能正常执行不报错, 求大神指点