I have a time series made of: dates, price1, price2. with lets say 392 observations, stored in a dataframe and previously streamed from an Api. I would like to add these rows to an existent xlsx file using openpyxl. However I don't know how to add these values to the xlsx. Can you help me?
y = df.sort_index(x, ascending=False) # sorted newest first
count = len(y)
print(count)
from openpyxl import load_workbook
wb = load_workbook(filename = 'Example.xlsx')
ws = wb['cc']
ws.insert_rows(1,count)
for row in range(2, count):
for col in range(1, 3):
_ = ws.cell(column=col, row=row, value=y)