At the moment it is writing the dataframes to a new workbook everytime from columns 1-> 4 rather then what I am after. How do I write dataframes to specific columns of an existing workbook?
df = pd.DataFrame(
{
'Team1': team1List,
'Back Odds': backOddsList,
'Team2': team2List,
'Lay Odds': layOddsList}, columns=(['AD'],['D'],['G'], ['Z']))
df[['AD','D', 'G', 'Z']].to_excel('output.xlsx', engine='openpyxl', sheet_name='Sheet_name_1', index=False
)
Full code