2021-04-06
阅读量:
572
python报错:TypeError: ‘>’not supported between instances of str and int
问:
python报错:TypeError: ‘>’not supported between instances of str and int

答:
这是因为原数据中的年龄字段是字符型,字符型的字段无法与数值型的‘50’进行比较,
将年龄字段的数据类型改为数值型即可:df.年龄 = df.年龄.astype('int')。
108.9473
1
0
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
0条评论
0条评论
0条评论

