Here is an example of my dataframe (my actual dataframe has 20+ columns and 100+ rows)
df = pd.DataFrame([['Jim', 93, 87, 66],
['Bob', 88, 90, 65],
['Joe', 72, 100, 70]],
columns=['Name', 'Score1', 'Score2', 'Score3'])
Name Score1 Score2 Score3
Jim 93 87 66
Bob 88 90 65
Joe 72 100 70
I want to create a new table which shows the rank of each score in a column. For example, the desired output would be:
Name Score1 Score2 Score3
Jim 1 3 2
Bob 2 2 3
Joe 3 1 1
Is it possible to achieve this in pandas by looping through every column?