I want to append a dataframe to a Google sheet that already has some values. I want to identify the first empty column and append the dataframe there.
Currently I'm pasting a dataframe to Google sheet using the code:
import pygsheets
gc = pygsheets.authorize(service_file='client_secret.json')
sh = gc.open_by_url('URL')
wks = sh[0] #Selecting the sheet
wks.set_dataframe(df, 'A1')
# A1 is the cell where the dataframe is pasted
I want to be able to identify this column 'A1' - where A is the first empty column in the Google sheet and paste my dataframe there.
How do I do this using Python? I'm currently using pygsheets, though I'm open to solutions using any other packages.