Returning the index of a row in dataframe

Mahmood Naderan nt_mahmood at yahoo.com
Sun Nov 14 04:01:51 EST 2021


Hi

In the following dataframe, I want to get the index string by specifying the row 
number which is the same as value column.


                     Value
    global loads       0
    global stores      1
    local loads        2


For example, `df.iloc[1].index.name` should return "global stores" but the 
output is `None`. Any idea about that?


Regards,
Mahmood


More information about the Python-list mailing list