'Gspread to create a pivot table with index and columns on Google Sheets
I am running this code below,
sh = gc.open_by_url('..........')
worksheet = sh.worksheet('Sheet1')
worksheet.update([df2.columns.values.tolist()] + df2.values.tolist()+df2.index.values.tolist())
df2 is a multi-index pivot table and running this code writes only the values and columns but does not include the index on Google sheets. Is there a way to include the index and the ability to change the format of the header on Google sheets?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
