Currently I'm running a live test that uses 3 variables data1, data2 and data 3. The Problem is that whenever I run my python code that it only writes to the first row within the respective columns and overwrites any previous data I had.
import pandas as pd
import xlsxwriter
from openpyxl import load_workbook
def dataholder(data1,data2,data3):
df = pd.DataFrame({'Col1':[data1],'Col2':[data2],'Col3':[data3]})
with pd.ExcelWriter('data_hold.xlsx', engine='openpyxl') as writer:
df.to_excel(writer,sheet_name='Sheet1')
writer.save()
Is what I'm trying to accomplish feasible?