- 博客(1)
- 收藏
- 关注
原创 TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType‘
运行环境:python 3.6.6pandas 1.1.2问题描述:使用pandas的astype()方法的时候报错TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType’df['store_rank'] = df['store_rank'].astype(int) 原因分析:'store_rank’这一列里面有空数据(NaN),导致转为int类型的时候报错
2021-04-08 13:49:05
27522
3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人