Multi Index Sorting in Pandas
When sorting by a MultiIndex you need to contain the tuple describing the column inside a list*: In [11]: df.sort_values([(‘Group1’, ‘C’)], ascending=False) Out[11]: Group1 Group2 A B C A B C 2 5 6 9 1 0 0 1 1 0 3 2 5 7 3 7 0 2 0 3 5 * so as … Read more