summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorDavid Stansby <dstansby@gmail.com>2020-11-27 20:41:50 +0000
committerDavid Stansby <dstansby@gmail.com>2020-11-27 20:41:50 +0000
commitfd821c8dc5e39879e684467e4326083822e7a796 (patch)
treedc47f88f665714e14805b6376b0784b364915445 /numpy/lib/function_base.py
parentb66d03dfc4958d159c5dc3ddc9075f8bcc47f9c5 (diff)
downloadnumpy-fd821c8dc5e39879e684467e4326083822e7a796.tar.gz
Make it clearer that np.interp input must be monotonically increasing
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 984f3086e..696fe617b 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1290,7 +1290,7 @@ def _interp_dispatcher(x, xp, fp, left=None, right=None, period=None):
@array_function_dispatch(_interp_dispatcher)
def interp(x, xp, fp, left=None, right=None, period=None):
"""
- One-dimensional linear interpolation.
+ One-dimensional linear interpolation for monotonically increasing sample points.
Returns the one-dimensional piecewise linear interpolant to a function
with given discrete data points (`xp`, `fp`), evaluated at `x`.
@@ -1337,8 +1337,8 @@ def interp(x, xp, fp, left=None, right=None, period=None):
--------
scipy.interpolate
- Notes
- -----
+ Warnings
+ --------
The x-coordinate sequence is expected to be increasing, but this is not
explicitly enforced. However, if the sequence `xp` is non-increasing,
interpolation results are meaningless.