1、matplotlib 处理csv表格读取数字画图时报错
low = int(row[5])
ValueError: invalid literal for int() with base 10: ‘’
原因是:row[5]某几行字符串是’’空,无法转换成int型,此处需要做错误检查 try except else,大概率的表格数据存在字段缺失问题,此用法保证程序继续运行下去。
matplotlib中csv数据缺失

注:问题对应书《python编程:从入门到实践》,chapter 16.1 P322

相关文章:

  • 2021-10-22
  • 2021-06-03
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
猜你喜欢
  • 2021-10-14
  • 2022-12-23
  • 2021-05-13
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案