VOOZH about

URL: https://www.geeksforgeeks.org/python/scipy-stats-percentileofscore-python/

⇱ sciPy stats.percentileofscore() | Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

sciPy stats.percentileofscore() | Python

Last Updated : 24 Nov, 2022

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.
 

Parameters : 
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. 


Code #1: 
 

Output:

arr : [20, 2, 7, 1, 7, 7, 34]

Percentile of 7 : 57.1428571429

Percentile of 34 : 100.0

Percentile of 2 : 28.5714285714
Comment