By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Python dataframe write into specific existing excel file

P: 1
Trying to write dataframe into existing excel file to a specific column without deleting existing data. Code sample:
Expand|Select|Wrap|Line Numbers
  1. import pandas
  2.  
  3. from openpyxl import load_workbook
  4.  
  5. writer = pd.ExcelWriter('test.xlsx', engine='xlsxwriter')
  6.  
  7. df.to_excel(writer, sheet_name='sheet1', startrow=1, startcol=57, index=False, engine='openpyx1')
  8.  
  9. writer.save()
  10.  
Jun 8 '16 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 614
"pd" & "df" have not been declared, if that is what you are asking about.
Jun 8 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.