python sort、sort_index方法(排序)

對Series進行排序 #生成序列obj obj=pd.Series([4,9,6,20,4],index=['d','a','e','b','c']) d 4 a 9 e 6 b 20 c 4 dtype: int64 #按obj的索引排序,默認升序,降序可在括號加ascending=False obj.sort_index() a 9 b
相關文章
相關標籤/搜索