2020-11-29
阅读量:
3173
python报错: AttributeError: 'float' object has no attribute 'lower'
问:
python报错:
AttributeError: 'float' object has no attribute 'lower'
答:
出现以上报错是因为数据中存在的缺失值np.nan属于float类型,float型数据不支持lower()方法,解决方法是使用pandas提供的str属性来处理字符串即可自动排除缺失值:






推荐帖子
0条评论
0条评论
0条评论