summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-07-06 08:22:23 -0700
committerGitHub <noreply@github.com>2022-07-06 08:22:23 -0700
commit96895a1d3e316dcb56b1ba451d5630e35f4c3c58 (patch)
treed8889ea647e682e125540ff4663f52cd3c595995 /numpy/lib/function_base.py
parentfa5bffc454fbafacfb3298ac30ea335635b54d07 (diff)
parenta63587eadc5934158a97aca3fec8a3bb8ca255e1 (diff)
downloadnumpy-96895a1d3e316dcb56b1ba451d5630e35f4c3c58.tar.gz
Merge pull request #21905 from deego/main
DOC: Fix the interpolation formulae for quantile and percentile
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index ca82bb72d..fb5dd6fdd 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -4000,7 +4000,7 @@ def percentile(a,
With 'i' being the floor and 'g' the fractional part of the result.
.. math::
- i + g = (q - alpha) / ( n - alpha - beta + 1 )
+ i + g = q * ( n - alpha - beta + 1 ) + alpha
The different methods then work as follows
@@ -4279,7 +4279,7 @@ def quantile(a,
and alpha and beta are correction constants modifying i and j:
.. math::
- i + g = (q - alpha) / ( n - alpha - beta + 1 )
+ i + g = q * ( n - alpha - beta + 1 ) + alpha
The different methods then work as follows