how to get the index of ith item in pandas.Series : <p>I'm trying to get the index of 6th item in the Series I have.</p>

<p>This is how the head looks like</p>

<pre><code>United States    1.536434e+13
China            6.348609e+12
Japan            5.542208e+12
Germany          3.493025e+12
France           2.681725e+12
</code></pre>

<p>For getting the 6th index name ( 6th Country after being sorted ), I usually use s.head(6) and get the 6th index from there</p>

<p>s.head(6) gives me</p>

<pre><code>United States     1.536434e+13
China             6.348609e+12
Japan             5.542208e+12
Germany           3.493025e+12
France            2.681725e+12
United Kingdom    2.487907e+12
</code></pre>

<p>and looking at this, I'm getting the index as United Kingdom.</p>

<p>So, is there any better way for getting the index other than this. And also, for a data frame, is there any function to get the 6th index on basis of a respective column after sorting. </p>

<p>If it's data frame, I usually, sort, create a new column named index, and use reset_index and then use iloc attribute to get the 6th ( Since, it will be using an range in the index after reset ). </p>

<p>Is there any better way in doing this with pd.Series and pd.DataFrame.</p>

<p>Thank you. </p>
