df.sort_values(["赛事","公司","推荐","赔率"],ascending=[,False,False,True],inplace=True)其中赛事想按照["英超","德甲","意甲","西甲","法甲","英冠","荷甲"]排序
时间: 2024-03-30 13:31:58 浏览: 129
df.rank & pd.pivot_table & pd.read_excel & df添加行 &调整df行列顺序(reindex再理解)
df.sort_values(["赛事","公司","推荐","赔率"], ascending=[True,False,False,True], inplace=True)是一个对DataFrame进行排序的操作。其中,按照"赛事"列进行排序,排序顺序为["英超","德甲","意甲","西甲","法甲","英冠","荷甲"],同时按照"公司"列进行降序排序,按照"推荐"列进行降序排序,最后按照"赔率"列进行升序排序。
阅读全文