今天在做数据房客网数据分析过程中碰到一个奇怪问题
ValueError: invalid literal for int() with base 10: '49.8'
出现问题部分代码:
for price in county_price:
if int(price)>1000:
index+=1
sum+=int(price)
mean = round(sum/index,2)
解决方式,将int转化为float即可