Implement percentile(x, q) for q in [0, 100] without np.percentile, matching its default (linear) method:
percentile(x, q)
q
[0, 100]
np.percentile
sort the data, compute the position h = (n - 1) * q / 100, and interpolate between the values at floor(h) and ceil(h).
h = (n - 1) * q / 100
floor(h)
ceil(h)