[英]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.我正在尝试使用 df2gspread 库将 DataFrame 上传到 Google 表格。 The upload is successful, however, it also uploads the index of my DataFrame.
上传成功了,不过也上传了我的DataFrame的索引。 Is there anyway to not have the index of my dataframe be included in the upload?
无论如何,我的 dataframe 的索引是否不包含在上传中?
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 https://gyazo.com/492838f2c5f8d8b05df3365e5f206186
Thank you to @Chris for your comment.感谢@Chris 的评论。 I needed to set row_names to False.
我需要将 row_names 设置为 False。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.