The score at percentile = 50 is the median. If the required quantile lies between two data points, we interpolate them among ourselves according to the interpolation value.
Parameters:
arr: [array_like] input array.
per: [array_like] Percentile at which we need the score.
limit: [tuple] the lower and upper limits within which to compute the percentile.
axis: [int] axis along which we need to calculate the score.Results: Score at Percentile relative to the array element.
Code # 1:
< p> print ( "Score at 100th percentile:" ,
|
Exit :
arr: [20, 2, 7, 1, 7, 7, 34, 3] Score at 50th percentile: 7.0 Score at 90th percentile: 24.2 Score at 10th percentile: 1.7 Score at 100th percentile: 34.0 Score at 30th percentile: 3.4
Code # 2:
|
Exit:
arr: [[14, 17, 12, 33, 44], [15 , 6, 27, 8, 19], [23, 2, 54, 1, 4]] Score at 50th percentile: 15.0 Score at 50th percentile: [17. 15. 4.] Score at 50th percentile: [15. 6 . 27. 8. 19.]