human
Faster way to rank rows in subgroups in pandas dataframe
assistant
Here is some code to get rank of rows from highest to lowest of dataframe `df`, grouped by value in column `group`, according to value in column `value`

df.groupby('group')['value'].rank(ascending=False)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.