简体   繁体   中英

How do I prevent uploading my index to Google Sheets when uploading a pandas DataFrame using df2gspread?

I'm trying to upload a DataFrame to Google Sheets using the df2gspread library. The upload is successful, however, it also uploads the index of my DataFrame. Is there anyway to not have the index of my dataframe be included in the upload?

My code:

spreadsheet_key = '1Rg1AUhwz771Rt8LYNtmdgTfeXZdYVNT5o8sW3nlkUQg'
wks_name = 'Master'
d2g.upload(df_result, spreadsheet_key, wks_name, row_names=True)

My Spreadsheet:

https://gyazo.com/492838f2c5f8d8b05df3365e5f206186

Thank you to @Chris for your comment. I needed to set row_names to False.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM