【发布时间】:2020-07-10 01:08:00
【问题描述】:
我正在尝试按“百分比”对数据框的内容进行排序。排序似乎不起作用。
代码- enter image description here
ipl_tot['Win Percent'] = ipl_tot['Matches Won']/ipl_tot['Matches
Played'] * 100
ipl_tot.sort_values(by = (['Matches Won', 'Win Percent']),ascending =
False)
ipl_tot
【问题讨论】:
-
您需要重新分配数据框或在
sort_values方法中添加inplace=True参数。
标签: python pandas dataframe jupyter