Skip to content Skip to sidebar Skip to footer

Append A Pandas Dataframe To An Existing Excel Table

I need some help with the following. I currently use python pandas to open a massive spreadsheet every day (this spreadsheet is a report, hence every day the data inside the spread

Solution 1:

If you use openpyxl's utilities for dataframes then you should be able to do everything you need with the existing workbook, assuming this fits into memory.

from openpyxl import load_workbook
from openpyxl.utils.dataframe import dataframe_to_rows
wb = load_workbook("C:\Andrea\master_file.xlsx")
ws = wb[SHEETNAME]
for row in dataframe_to_rows(dt_today):
    ws.append(row)

Post a Comment for "Append A Pandas Dataframe To An Existing Excel Table"