Percentiles by Linear Interpolation

easy
Unit 3 · Statistics III0/3 to milestone

Implement percentile(x, q) for q in [0, 100] without np.percentile, matching its default (linear) method:

sort the data, compute the position h = (n - 1) * q / 100, and interpolate between the values at floor(h) and ceil(h).

#statistics#quantiles2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Percentiles by Linear Interpolation · TechGradify