summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorCloseChoice <tobias.pitters@gmx.de>2020-05-21 12:29:57 +0200
committerTobias Pitters <tobias.pitters@gmail.com>2020-05-27 19:35:59 +0200
commit54de868a1a37b182a94f2d521fe2c695bf19ddea (patch)
tree4e44a60107cbded801cee243d8d5237b92eeee46 /numpy/lib/function_base.py
parent3b0516aded2f0ebc09511db63978c1f1a2445a43 (diff)
downloadnumpy-54de868a1a37b182a94f2d521fe2c695bf19ddea.tar.gz
add hypothesis test, fix bug of non-monotonic ordering of quantile function
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 48b0a0830..3fb45b09a 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -3875,7 +3875,8 @@ def _quantile_is_valid(q):
def _lerp(a, b, t, out=None):
""" Linearly interpolate from a to b by a factor of t """
- return add(a*(1 - t), b*t, out=out)
+ offset = subtract(b, a) * t
+ return add(a, offset, out=out)
def _quantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False,
@@ -3948,6 +3949,7 @@ def _quantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False,
else:
# weight the points above and below the indices
+ #import pdb; pdb.set_trace()
indices_below = not_scalar(floor(indices)).astype(intp)
indices_above = not_scalar(indices_below + 1)