I am creating a pivot table with Pandas but got stuck at the subtotals for rows within different columns (under the same Values) for a while, I\'ve done some research on sta
pivot_table doesn't support it, but you can compute it yourself and concatenate it later:
pivot_table
tb.groupby(level='Op', axis=1).sum().add_suffix('Total') Op Total ATotal BTotal Tm 07-01-2018 200 100 100 08-01-2018 400 200 200 09-01-2018 600 300 300 All 1200 600 600