faster way to rank rows in subgroups in pandas dataframe,df.groupby('group')['value'].rank(ascending=False)