I have some data in an excel file (a snippet of it is shown in the figure below:
I would like to iterate through each of the columns and update their values. I have attempted the following...however it gives me an error which is unclear: "KeyError: 32.5". Any help to get around this would be much appreciated!
def iterate (data, cost_T, int_T, cost_F, int_F):
for i, j in zip(data.iloc[:, 0], data.iloc[:, 1]):
data[i] = (data[i]- cost_T)/int_T
data[j] = (data[j]- cost_F)/int_F
iterate (df, 455, 31, 501, 42)
