参考:1、https://blog.csdn.net/toshibahuai/article/details/79034829

   2、https://blog.csdn.net/lanyang123456/article/details/55804982

1、可以利用to_csv方法将csv存为文本格式,并指定分隔符。需要注意的是,在写入后,如报错 ValueError: invalid literal for int() with base 10: '8.0'

a = int(val)

改为 a = int(float(val))即可运行

 

2、还可能遇到错误‘ ’不能转换为int型,这里添加个异常处理即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-06-11
  • 2021-07-11
  • 2021-11-23
  • 2022-12-23
  • 2021-04-17
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2021-04-10
  • 2021-04-09
  • 2022-02-14
  • 2021-10-01
  • 2021-03-26
相关资源
相似解决方案