Skip to content Skip to sidebar Skip to footer

Incorrect First Quantile And Third Quantile Value Over Array Using Numpy

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)

Solution 1:

For some ungodly reason statistics as a discipline hasn't defined exactly what a quartile is, despite using it in many "standard" formulas. Here's three different methods of calculating it which which are all very different. Luckily when datasets are large the differences are small, but with only five values . . . well, you can get some very big differences.

  • Your online calculator uses method 1 and returns [1.5, 4.5].

  • The answer with method 2 would be [2, 4]

  • numpy uses method 3 and returns [2, 4]

It seems to me like methods 2 and 3 would always give the same answer but there may be differences I haven't seen.

Post a Comment for "Incorrect First Quantile And Third Quantile Value Over Array Using Numpy"