scipy.stats.percentileofscore(a, score, kind='rank') function helps us to calculate percentile rank of a score relative to a list of scores.
Suppose percentile of x is 60% that means that 80% of the scores in a are below x.
arr : [array_like] input array.
score : [int or float] Score compared to the elements in array.
kind : [optional] ‘rank’, ‘weak’, ‘strict’, ‘mean’.
Results : Percentile of the scores relative to the array element.
arr : [20, 2, 7, 1, 7, 7, 34] Percetile of 7 : 57.1428571429 Percetile of 34 : 100.0 Percetile of 2 : 28.5714285714
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course