Python Forum
Updating the Pandas dataframe to existing excel workbook in existing worksheet. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Updating the Pandas dataframe to existing excel workbook in existing worksheet. (/thread-11278.html)



Updating the Pandas dataframe to existing excel workbook in existing worksheet. - sanmaya - Jul-01-2018

Hi All,

i am new to python programming, i was trying to read as huge CSV file with pandas dataframe using df=pd.read_csv.
after reading the data into the data frame i need to update the same data to the existing excel workbook in existing worksheet.
but my problem is i am seeing that the excel is not updating at all.

anyone can help me with this please if they have solution.
below is mycode
import pandas as pd
filename='D:/Users/Python Codes/SchoolSample.xlsx'
writer=pd.ExcelWriter(filename,engine='openpyxl')
df=pd.read_csv('D:/Users/Python Codes/C2ImportSchoolSample.csv',sep=',',engine='python')
df.to_excel(writer,sheet_name='Sheet1',index=False,header=None)
writer.save()



RE: Updating the Pandas dataframe to existing excel workbook in existing worksheet. - volcano63 - Jul-01-2018

Which version of Python and which version of pandas ? Have you tried without the engine argument?