I have to Run this code everyday and store dataframe in new columns How to Store the data frame to next column automatically without specifying the column number in excel file using Python Here dx stores the day of month i.e "09-11-2022" dx=9 so the data gets stored in column 9 but there will be gaps if i run it after some time like if dx=22 the columns between 9-22 will be empty So how to store data to next new column without specifying the startcol
df1 = pd.DataFrame({today:mob})
df2 = pd.DataFrame({today:dtop})
writer=pd.ExcelWriter('Pagespeed.xlsx',mode='a',engine="openpyxl",
if_sheet_exists='overlay')
df1.to_excel(writer, index=False,sheet_name='Mobile',startcol=dx)
df2.to_excel(writer,index=False,sheet_name='Desktop',startcol=dx)
writer.save()