I am trying to create a loop which will read each excel file and perform the calculations on them.
What I have is:
n=150
for i in range(n):
dw = pd.read_excel(str(i) + '.xlsx')
print(dw)
(Thereafter, I perform calculations on them - I just printed the result to see if it imported the files correctly)
However when I run this, it runs the last excel file (file named 150.xlsx) 150 times. (Instead of each of the files once.)
Is there a way around this?
print (i)to confirm the iteration values. you might addeddw = pd.read_excel(str(n) + '.xlsx')check the running code properly.