diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-07-06 08:22:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-06 08:22:23 -0700 |
commit | 96895a1d3e316dcb56b1ba451d5630e35f4c3c58 (patch) | |
tree | d8889ea647e682e125540ff4663f52cd3c595995 /numpy/lib/function_base.py | |
parent | fa5bffc454fbafacfb3298ac30ea335635b54d07 (diff) | |
parent | a63587eadc5934158a97aca3fec8a3bb8ca255e1 (diff) | |
download | numpy-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.py | 4 |
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 |