Sorting a pandas series

前端 未结 1 1174
故里飘歌
故里飘歌 2020-11-29 05:30

I am trying to figure out how to sort the Series generated as a result of a groupby aggregation in a smart way.

I generate an aggregation of my DataFrame like this:<

相关标签:
1条回答
  • 2020-11-29 05:52

    Use sort_values, i.e. means = means.sort_values(). [Pandas v0.17+]


    (Very old answer, pre-v0.17 / 2015)

    pandas used to use order() method: means = means.order().

    0 讨论(0)
提交回复
热议问题