So I want to save 2 dataframes into 2 different worksheets, but the same file. My code for this part is:
df.to_excel(path, sheet name = 'sheet1')
df2.to_excel(path, sheet name = 'sheet2')
And for some reason the code ignores the first part, the excel file only has sheet2 with df2 on it, sheet1 is nowhere to be found. Before I added the df2 part the code saved the df perfectly fine. Why is that, how could I fix this?