Return the column name(s) for a specific value in a pandas dataframe

后端 未结 4 1354
孤独总比滥情好
孤独总比滥情好 2020-12-08 23:40

where I have found this option in other languages such as R or SQL but I am not quite sure how to go about this in Pandas.

So I have a file with 1262 columns and 1 r

4条回答
  •  醉酒成梦
    2020-12-08 23:50

    just for the sake of throwing something a bit different into the ring:

    row = df.iloc[0]
    row.reset_index().set_index(0).loc[38.15]
    

提交回复
热议问题