I want to select the maximum value in the data frame, and then find out the index and column name of this value. Is there any way to do this?
Say, in the example below, I want to first find the maximum value ( 31), and then return the index and column name of this value(20, R20D)
a = pd.DataFrame({'R05D':[1,2,3],'R10D':[7,4,3],'R20D':[31,2,4]},index=[20,25,30])
Thank!
source
share