【问题标题】:Sorting Pandas Series by unnamed value rather than index [duplicate]按未命名值而不是索引对 Pandas 系列进行排序 [重复]
【发布时间】:2021-10-28 13:04:51
【问题描述】:

我有一个熊猫系列,它有 1 个索引(国家)和一个带有平均值的未命名列。我想根据值而不是索引按降序对系列进行排序。这是该系列目前的样子:

【问题讨论】:

标签: python pandas series


【解决方案1】:
series.sort_values(ascending=False)

【讨论】:

    猜你喜欢
    • 2022-08-19
    • 1970-01-01
    • 2013-10-09
    • 1970-01-01
    • 1970-01-01
    • 2016-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多