Hello I have been trying to save some time automating processes and was struggling at the last huddles of taking the dataframes collected and exporting each into the same excel file with unqiue sheet names.
DFS = []
ListofSources = ['example','example2']
for Source in ListofSources:
DFS.append(self.Makesadataframe(Source )
RowCount=0;
filename = "test.xlsx"
for DF in DFS:
sheetname = ListofSources[RowCount]
print(sheetname)
print(DF)
with pd.ExcelWriter(filename) as writer:
print("Creating sheet "+sheetname)
DF.to_excel(writer, sheet_name=sheetname)
RowCount+= 1