2020-09-21
阅读量:
2545
python报错: AttributeError: 'float' object has no attribute 'lower'
问:
python报错:
AttributeError: 'float' object has no attribute 'lower'


答:
出现以上报错是因为数据中存在的缺失值np.nan属于float类型,float型数据不支持lower()方法,解决方法是使用pandas提供的str属性来处理字符串即可自动排除缺失值:

38.6003
1
0
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
0条评论
0条评论
0条评论

