I am new to python. I am sure there is simple way to do this but I am struggling a bit.
I have 100 dataframes with names Lens1,Lens2, ..., Lens100.
I want to write each dataframe to a csv file.
Lens1.to_csv(path+"lens 1.csv", index=False) This command for Lens2 and Lens2.csv... and so on till Lens100 save as Lens100.csv. so a 100 times...
I have tried the following:
for key,j in range(101):
x='Lens%s'%(j)
x.to_csv(path+x+".csv")
It does not seem to work and the error is
'str' object has no attribute 'to_csv'.
Any help will be much appreciated.