df = pd.DataFrame({'class':['A','A','A','B','B','B','C','C'], 'id':['a','b','c','a','b','c',a','b'], 'value':[1,2,3,4,5,6,7,8]})
df = df.set_index(['class','id'])
如何能对index排序,使class为升序,id为降序, 最后显示的结果类似于:
class id value
A c 3
A b 2
A a 1
B c 6
B b 5
B a 4
C b 8
C a 7