import pandas as pd x = pd.DataFrame({"x1":[1,2,2,3],"x2":[4,3,2,1]}) x.set_index('x1',inplace=True) x.sort_index(ascending =False) 二、sort_values DataFrame.sort_values(by, axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last') 参数说明: axis:...