Let's say I have a django queryset of objects User
. Each User
has an average_score
. How can I determine the user's percentile (top 10%, top 20%, etc) based on the average_score
?
If I were able to sort the queryset, I could theoretically take the index divided by the total count (eg 5th place out of 100 total is top 5%) but since we can't sort querysets– what can I do here?