notebook 中数据类型使用错误问题

jupyter notebook 中数据类型错误问题
数据类型:

img

代码:
for i in range(12,16):
    temp[:,i-12] = data.iloc[:,i]-data.iloc[:,i-1]/data.iloc[:,i-1]
#x['主营业务增长率'] = np.mean(temp,axis=1)
报错:

TypeError: unsupported operand type(s) for -: 'str' and 'float'

问题:

1.怎么修正?
2.temp[],内置在for i in range(12,16)怎么理解?

麻烦各位解惑,十分感谢!

你列表里的值都是字符串类型的,不能和浮点数相减,需要将你的字符串转化为整数或者浮点数,才可以和浮点数相减。
temp[]放在for里面就是实时地储存数据了
望采纳!谢谢