Python Forum

Full Version: Updating the Pandas dataframe to existing excel workbook in existing worksheet.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
Which version of Python and which version of pandas ? Have you tried without the engine argument?