df=pd.DataFrame({'Fruit':['Apple', 'Orange', 'Apple', 'Apple', 'Orange', 'Orange'],
'Variety':['Fuji', 'Navel', 'Honeycrisp', 'Gala', 'Tangerine', 'Clementine'],
'Count':[2, 5, 5, 1, 8, 4]})
df_pvt=pd.pivot_table(df, index=['Fruit','Variety'], values=['Count'], aggfunc=np.sum)
df=pd.concat([d.append(d.sum().rename((k, 'SubTotal'))) for k, d in df_pvt.groupby(level=0)]).append(df_pvt.sum().rename(('','GrandTotal')))
How do I get the 'SubTotal', 'GrandTotal' and those values 'bold' and the rest of the font under Variety and Count as 'normal' font_weight, just like the image I have? Or any other way where I can have the subtotals and Grand totals pop out then rest of the dataframe.