473,394 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Python dataframe write into specific existing excel file

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
1 8953
dwblas
626 Expert 512MB
"pd" & "df" have not been declared, if that is what you are asking about.
Jun 8 '16 #2

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

Similar topics

0
by: Zero | last post by:
how to Overwrite Existing Excel File without prompt and quit?
0
by: QuenteK25 | last post by:
Ok so I'm pretty novice at all of this VB stuff, but I have to do a personal project for a class I'm in and it's in VB. So there are a few things I want to do for it that we have never covered in...
6
by: jcf378 | last post by:
hello-- i am having trouble figuring out how to export individual records from an Access 2002 Form into a pre-existing Excel spreadsheet, such that the exported record is merely appended to the...
5
by: Aspgm | last post by:
Hi Everyone, I have an Excel file to update on-line using ASP. I could write data to a fresh excel file. But I couldn't find a way to open an existing Excel file and update relevant cells. If...
0
by: jetaw03 | last post by:
guys, i need help in using VB 6.0.can you help me to get a data from an excel file from ms access and put it in ms excel..pls help me guys.. here is the sample of the file in access: sum1 sum2...
1
by: Mohanapriya | last post by:
Hi, Is there a way to write the text message in color or bold using UTL.FILE in PL/SQL. For ex:Iam creating a excel file and writing the text message to the file which should come in specific color...
3
by: thanawala27 | last post by:
Hi, I had problems writing in an existing Excel File. There is an excel file with a worksheet. I would like to open this existing Excel file and add another worksheet and write data into it....
3
by: premMS143 | last post by:
How to append Data to an existing Excel file? means, I'm using VB as front end & once I exported the data to Excel file & saved it as 'ABC.xls'. Now, the question/doubt is; I addded some more...
4
by: Ashcraft | last post by:
Tried googling and got maybe some older examples of how to solve this problem. But when I tried they didn't seem to work. I'm able to create and write to a new file but not sure how to edit an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.