2016-10-06 10 views

答えて

3

使用tail

s.tail(5) 

またはiloc

s.iloc[-5:] 

サンプル:

s = pd.Series(range(10))  
print (s) 
0 0 
1 1 
2 2 
3 3 
4 4 
5 5 
6 6 
7 7 
8 8 
9 9 
dtype: int32 

print (s.tail(5)) 
5 5 
6 6 
7 7 
8 8 
9 9 
dtype: int32 

print (s.iloc[-5:]) 
5 5 
6 6 
7 7 
8 8 
9 9 
dtype: int32 
関連する問題