热线电话:13121318867

登录
2020-09-21 阅读量: 2333
python报错: AttributeError: 'float' object has no attribute 'lower'


问:

python报错:

AttributeError: 'float' object has no attribute 'lower'


image.png

image.png


答:


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

image.png

38.6003
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子