Mailing List Archive

Returning the index of a row in dataframe
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
--
https://mail.python.org/mailman/listinfo/python-list
Re: Returning the index of a row in dataframe [ In reply to ]
>>> df.iloc[1].name


Correct.... I also see that 'df.index[1]' works fine.
Thanks.


Regards,
Mahmood



--
https://mail.python.org/mailman/listinfo/python-list