-
-
Notifications
You must be signed in to change notification settings - Fork 19k
Closed
Labels
API DesignDuplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestIO Excelread_excel, to_excelread_excel, to_excel
Description
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
import pandas as pd
import numpy as np
import os
if __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 expected
new_sheet = writer.book.add_worksheet("thing2")
new_sheet.write(1,1,"test")
print writer.book.sheetnames
writer.save()
writer.close()
Metadata
Metadata
Assignees
Labels
API DesignDuplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestIO Excelread_excel, to_excelread_excel, to_excel