I want to find the highest 3 values of each column in a dataframe, and return the index names, ordered by value. The dataframe looks like this:
df = pd.DataFrame({"u1":[1,2,-3,4,5],
"u2":[8,-4,5,6,7],
"u3":[np.NaN,np.NaN,np.NaN,np.NaN,np.NaN]},
index=["q1","q2","q3","q4","q5"])
The result would look like this:
u1 u2 u3
q5 q1 NaN
q4 q5 NaN
q2 q4 NaN