I have simple code to export python dataframe to existing excel file with sheets but the writer keep deleting the existing sheet from the file
read = pd.ExcelFile('Saw_Load.xlsx')
print(read.sheet_names)
writer = pd.ExcelWriter('Saw_Load.xlsx')
result.to_excel(writer,'saw', index = False)
read2 = pd.ExcelFile('Saw_Load.xlsx')
print(read2.sheet_names)
writer.save()
Here is the output i am getting
['saw', 'Pivot']
['saw']
We can clearly see before to_excel function was used there were 2 sheets (saw,Pivot). After there is only one 'saw'
It could be a simple fix in formula but couldn't seem to find anything that works. Any help will be appreciated
Thanks