擅长:python、mysql、java
<p>这是因为使用了整数索引(<code>ix</code>选择那些通过<em>label</em>over-3而不是<em>position</em>的索引,这是按设计的:请参见<a href="http://pandas.pydata.org/pandas-docs/dev/gotchas.html#integer-indexing" rel="noreferrer">integer indexing in pandas "gotchas"</a>*)。</p>
<p>*在较新版本的熊猫中,更喜欢loc或iloc来消除ix作为位置或标签的模糊性:</p>
<pre><code>df.iloc[-3:]
</code></pre>
<p><em>参见<a href="http://pandas.pydata.org/pandas-docs/dev/indexing.html#different-choices-for-indexing-loc-iloc-and-ix" rel="noreferrer">docs</a></em>。</p>
<p>正如韦斯指出的,在这种特殊情况下,你应该只使用尾巴!</p>