热线电话:13121318867

登录
2020-11-29 阅读量: 3173
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


89.6724
1
关注作者
收藏
评论(1)

发表评论
CDA114404
2021-10-20

我这个怎么解决?

VGHPOU5LJ(CJIQT`EJY_$T9.png

JI`03YK[LW73EZH`1~%L3KE.png

0.0000 0 0 回复
推荐帖子
条评论