From efaaa96767e3ca048a3cd01107d811e345e3438c Mon Sep 17 00:00:00 2001 From: mattip Date: Tue, 15 Oct 2019 18:03:11 +0300 Subject: DOC: convert `None` to bare None or ``None`` --- numpy/lib/function_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/function_base.py') diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 46950bc95..a81b1c816 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1889,7 +1889,7 @@ class vectorize(object): typecode characters or a list of data type specifiers. There should be one data type specifier for each output. doc : str, optional - The docstring for the function. If `None`, the docstring will be the + The docstring for the function. If None, the docstring will be the ``pyfunc.__doc__``. excluded : set, optional Set of strings or integers representing the positional or keyword -- cgit v1.2.1 From 83da5faca3a313c5d37226b86fa781956f8d162b Mon Sep 17 00:00:00 2001 From: "Zijie (ZJ) Poh" <8103276+zjpoh@users.noreply.github.com> Date: Tue, 15 Oct 2019 12:13:22 -0700 Subject: DOC: Add to doc that interp cannot contain NaN (#14598) Address gh-13919 by adding to documentation that xp cannot contain NaN because its input is required to be sorted. Closes gh-13919 --- numpy/lib/function_base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'numpy/lib/function_base.py') diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 46950bc95..c39c2eea1 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1314,9 +1314,13 @@ def interp(x, xp, fp, left=None, right=None, period=None): Notes ----- - Does not check that the x-coordinate sequence `xp` is increasing. - If `xp` is not increasing, the results are nonsense. - A simple check for increasing is:: + 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. + + Note that, since NaN is unsortable, `xp` also cannot contain NaNs. + + A simple check for `xp` being strictly increasing is:: np.all(np.diff(xp) > 0) -- cgit v1.2.1