You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using pd.ExcelWriter, it appears that calling the save method prevents you from subsequently creating new sheets. E.g. see the following test script
importpandasaspdimportnumpyasnpimportosif__name__=="__main__" :
dates=pd.date_range('20130101', periods=6)
df=pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD'))
currentpath=os.path.realpath(__file__)
outputpath=os.path.join(currentpath, "..\\test.xlsx")
writer=pd.ExcelWriter(outputpath)
df.to_excel(writer, "thing1")
writer.save() #if you remove this line it works as expectednew_sheet=writer.book.add_worksheet("thing2")
new_sheet.write(1,1,"test")
printwriter.book.sheetnameswriter.save()
writer.close()
The text was updated successfully, but these errors were encountered:
When using pd.ExcelWriter, it appears that calling the save method prevents you from subsequently creating new sheets. E.g. see the following test script
The text was updated successfully, but these errors were encountered: