I have data frame like this
A B C D
0 0.037949 0.021150 0.127416 0.040137
1 0.025174 0.007935 0.011774 0.003491
2 0.022339 0.019022 0.024849 0.018062
3 0.017205 0.051902 0.033246 0.018605
4 0.044075 0.044006 0.065896 0.021264
And I want to get the data frame with the index values of 3 largest values in each columns. Desired output
A B C D
0 4 3 0 0
1 0 4 4 4
2 1 0 3 3