1 dfxxx['username']=pd.to_numeric(dfxxx['username'],errors='coerce')#将不能转换数据类型的值强制转换成NaN
2 dfxxx['username']=pd.Series(dfxxx['username']//1,index=dfxxx.index,dtype=int)#当遇到.0情况可以用这种形式转换成int类型

 更多数据类型转换

https://vimsky.com/article/3694.html

相关文章:

  • 2022-01-05
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-01-06
  • 2021-10-13
  • 2021-07-06
  • 2022-12-23
  • 2021-12-05
  • 2021-05-26
相关资源
相似解决方案