May-07-2019, 08:50 PM
(This post was last modified: May-07-2019, 08:51 PM by wendysling.)
Hello,
I am trying to add a dataframe to an existing sheet. I don't see any error, but the data does not show on the sheet.
Is anyone able to tell me what am I missing?
Thank you!
I am trying to add a dataframe to an existing sheet. I don't see any error, but the data does not show on the sheet.
Is anyone able to tell me what am I missing?
Thank you!
#Grab dataframe from another excel sheet df = pd.read_excel('C:/path/Dataframe_File.xlsx',sheetname='Data') #Open existing excel file workbook1 = openpyxl.load_workbook('C:/path/Existing_File.xlsx') writer = pd.ExcelWriter('C:/path/Existing_File.xlsx', engine='openpyxl') #Add dataframe to excel file df.to_excel(writer,sheet_name="Sheet",index=False,startrow=17,startcol=1,engine='openpyxl') workbook1.save('C:/path/Existing_File.xlsx')