Python Forum
Updating the Pandas dataframe to existing excel workbook in existing worksheet.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating the Pandas dataframe to existing excel workbook in existing worksheet.
#1
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()
Reply


Messages In This Thread
Updating the Pandas dataframe to existing excel workbook in existing worksheet. - by sanmaya - Jul-01-2018, 01:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add NER output to pandas dataframe dg3000 0 450 Apr-22-2024, 08:14 PM
Last Post: dg3000
  Pandas keep existing format of Excel AlphaInc 2 1,909 Jan-11-2024, 03:44 AM
Last Post: plonkarchivist
  How to count total number of sheets in an excel workbook using polars sayyedkamran 0 820 Oct-27-2023, 09:54 PM
Last Post: sayyedkamran
  HTML Decoder pandas dataframe column mbrown009 3 1,283 Sep-29-2023, 05:56 PM
Last Post: deanhystad
  Use pandas to obtain cartesian product between a dataframe of int and equations? haihal 0 1,245 Jan-06-2023, 10:53 PM
Last Post: haihal
  validate the existing value and change the series datahub 0 1,290 May-03-2022, 08:00 PM
Last Post: datahub
  Pandas Dataframe Filtering based on rows mvdlm 0 1,559 Apr-02-2022, 06:39 PM
Last Post: mvdlm
  Pandas dataframe: calculate metrics by year mcva 1 2,508 Mar-02-2022, 08:22 AM
Last Post: mcva
  Pandas dataframe comparing anto5 0 1,368 Jan-30-2022, 10:21 AM
Last Post: anto5
  PANDAS: DataFrame | Replace and others questions moduki1 2 1,958 Jan-10-2022, 07:19 PM
Last Post: moduki1

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020