I need to put pivot table made with data frame in googlesheet. When i try to run it in jupyter it shows as it should:

but when i export data to googlesheet, index headers are missing as you can see from the pic below:

This is part of my code which is responsible for create dataframe and export it in googlesheet. i'm using pygsheets library to access googlesheets.
df1 = wks.get_as_df()
df1 = df1.apply(pd.to_numeric, errors='ignore')
df2 = pd.pivot_table(df1, index =['SSPU','Color'], columns = "Size",values='US 全库存',fill_value=0, aggfunc = sum, margins=True)
print(df2)
I checked many tutorials but didn't find a solution.