0

I'm getting the following error when trying to use d2g.upload() to save a DF back to a Google sheet:

TypeError: '<' not supported between instances of 'str' and 'int'

It is saving the index and the DF column names to the Google sheet, but not actually populating the data into the sheet.

No idea what's causing it, has anyone else encountered this same problem? Below is the code I'm using to save the DF back to Google sheets. I've used the same code for several other DF's and it works, I just don't know what's unique and this specific DF that's causing the issue. The Dtypes are all object / float. Any help would be greatly apprecaited!

from df2gspread import df2gspread as d2g 
wks_name = 'Linkedin_Campaign_Ad_Daily_Clean'

d2g.upload(li_ad_link_clicks, spreadsheet_key, wks_name, credentials=credentials, row_names=True)

1 Answer 1

2

I fixed this by deleting duplicate columns in my dataframe:

df = df.loc[:,~df.columns.duplicated()]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.