2021-01-29
阅读量:
1341
Python报错:AttributeError: 'float' object has no attribute 'lower'
问:
Python报错:AttributeError: 'float' object has no attribute 'lower'
答:
出现以上报错是因为数据中存在的缺失值np.nan属于float类型,float型数据不支持lower()方法,
所以会报'float' object has no attribute 'lower'错误,可以通过Pandas的str属性解决此问题,
使用str属性会自动排除缺失值,代码如下:






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论