’not supported between instances of str and int" /> ’not supported between instances of str and int,問:python報(bào)錯(cuò):TypeError: ‘>’not supported between instances of str and int答:這是因?yàn)樵瓟?shù)據(jù)中的年齡字段是字符型,字符型的字段" />

99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2021-04-06 閱讀量: 526
python報(bào)錯(cuò):TypeError: ‘>’not supported between instances of str and int

問:

python報(bào)錯(cuò):TypeError: ‘>’not supported between instances of str and int


答:

這是因?yàn)樵瓟?shù)據(jù)中的年齡字段是字符型,字符型的字段無法與數(shù)值型的‘50’進(jìn)行比較,


將年齡字段的數(shù)據(jù)類型改為數(shù)值型即可:df.年齡 = df.年齡.astype('int')。



108.9473
0
關(guān)注作者
收藏
評論(0)

發(fā)表評論

暫無數(shù)據(jù)
推薦帖子