Say I have this dataframe pictured in the 1st screenshot below, I want to rank the scores by Day without considering the "Total" value for each group.
The 2nd screenshot below is what I would like the output to look it.
What's an efficient way to do this?
data = pd.DataFrame({'Day':['Monday','Monday','Monday','Monday','Tuesday','Tuesday','Tuesday','Tuesday'],
'City':['NY','Chicago','Miami','Total','NY','Chicago','Miami','Total'],
'Score':[100,90,70,260,120,80,90,290]})


Take a view of the non-Total rows and perform the rank then assign it to a new 'Rank' column. Since the indices are still preserved, the Cities will receive the proper rank but the Total rows will default to NaN.