From 8eccbf7df2f564e23c1bf7c9f5ee08e4b0dc6a36 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 25 Feb 2018 11:28:31 -0800 Subject: BUG/MAINT: Remove special handling of 0d arrays and scalars in interp These are now handled generically by the underlying C function This fixes the period argument for 0d arrays. Now never returns a pure-python scalar, which matches the behaviour of most of numpy. Rework of b66a200a4a1e98f1955c8a774e4ebfb4588dab5b --- doc/release/1.15.0-notes.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/release/1.15.0-notes.rst b/doc/release/1.15.0-notes.rst index 2aa102316..eeb700812 100644 --- a/doc/release/1.15.0-notes.rst +++ b/doc/release/1.15.0-notes.rst @@ -119,5 +119,17 @@ For all types of scalar or 0d input, the result is now a scalar. ``np.flatnonzero`` now uses ``np.ravel(a)`` instead of ``a.ravel()``, so it works for lists, tuples, etc. +``np.interp`` returns numpy scalars rather than builtin scalars +--------------------------------------------------------------- +Previously ``np.interp(0.5, [0, 1], [10, 20])`` would return a ``float``, but +now it returns a ``np.float64`` object, which more closely matches the behavior +of other functions. + +Additionally, the special case of ``np.interp(object_array_0d, ...)`` is no +longer supported, as ``np.interp(object_array_nd)`` was never supported anyway. + +As a result of this change, the ``period`` argument can now be used on 0d +arrays. + Changes ======= -- cgit v1.2.3