for i in column1: x = int(i) s += xprint "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
时间: 2024-10-10 08:43:19