for i in column1:
x = int(i)
s += x
print "sum:",s,"count:",len(column1)
# round (s / len(column1), 3)
print "avg",round (s / len(column1), 3)


Traceback (most recent call last):
File "C:/3/csv测试.py", line 26, in <module>
x = int(i)
ValueError: invalid literal for int() with base 10: '18.4'

 

这里的错误在于用了int 应该用float

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2022-03-01
  • 2022-12-23
  • 2021-08-24
  • 2021-08-30
  • 2021-10-11
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2021-11-22
  • 2021-11-26
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案