2013-05-06 78 views

回答

13
In [28]: s = pd.Series([20, 10, 30], ['c', 'a', 'b']) 

In [29]: s 
Out[29]: 
c 20 
a 10 
b 30 
dtype: int64 

對指數

In [30]: s.sort_index(ascending=False) 
Out[30]: 
c 20 
b 30 
a 10 
dtype: int64 

上的值

In [31]: s.sort() 

In [32]: s[::-1] 
Out[32]: 
b 30 
c 20 
a 10 
dtype: int64