Reputation: 91
I have a dataframe like below:
d = pandas.DataFrame({1:{1,2,3}}, index={0:{103,104,105}})
I want to get the index of a given row. For example, the index of df.iloc[1] should be 104. How can I do that?
Upvotes: 1
Views: 136
Reputation: 8816
You must read the pandas.dataframe.index
documentation for the deep insight. Or pandas.DataFrame.index
nice documentation itself.
Upvotes: 0
Reputation: 64
You can use df.index[i]
where i is the number of the row you want starting from 0.
Upvotes: 2