I need help in understanding how the quantile function works in numpy. because the answers do not match with other quantile calculators.
arr = [1,2,3,4,5]
print("arr : ", arr)
print("Q2 quantile of arr : ", np.quantile(arr, .50))
print("Q1 quantile of arr : ", np.quantile(arr, .25))
print("Q3 quantile of arr : ", np.quantile(arr, .75))
I expected the output of Q1 to be 1.5 and Q3 to be 4.5 I verified it using an online calculator. It also differs from the answer given by numpy . Can someone help me in understanding how numpy calculates quantile and why is it different from the actual formula .
numpydoesprecentile(arr, 25), which is an approved method, but many others methods split the array twice, which removes the median when the array has an odd number of values.