if __name__ == '__main__': products = pd.read_excel("C:/Users/123/Desktop/pandas/007_排序_多重排序/List.xlsx", index_col="ID") print(products.head) # 排序 : 价格倒序 products.sort_values(by = "Price", inplace = True, ascending = False) print(products.head) # 排序 : 先排序值不值; 再排序价格 products.sort_values(by = ["Worthy", "Price"], inplace = True, ascending = [True, False]) print(products.head)