Python Pandas: Get index of rows which column matches certain value
df.iloc[i] returns the ith row of df. i does not refer to the index label, i is a 0-based index. In contrast, the attribute index returns actual index labels, not numeric row-indices: or equivalently, You can see the difference quite clearly by playing with a DataFrame with a non-default index that does not equal to the row’s numerical position: If you want to use the index, … Read more