diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2020-11-28 13:08:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-28 13:08:07 +0000 |
commit | f4aadabcc0e1968f3b309642af52ef11ae77ca01 (patch) | |
tree | 58b21445b7b6b7aa06a3639e6ad70aeaa0fe5d21 /numpy/lib/function_base.py | |
parent | 8d161acfdcaaa5f09efa7c2f675e74631da6b293 (diff) | |
parent | fd821c8dc5e39879e684467e4326083822e7a796 (diff) | |
download | numpy-f4aadabcc0e1968f3b309642af52ef11ae77ca01.tar.gz |
Merge pull request #17862 from dstansby/interp-docstring
DOC: 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.py | 6 |
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. |