From 5787098331249f2a0b4df4dd40fb91a83d29e2ae Mon Sep 17 00:00:00 2001 From: christos val Date: Sun, 21 Mar 2021 19:37:34 -0400 Subject: [PATCH 1/2] add asarray to polybase call method --- numpy/polynomial/_polybase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py index b04b8e66b09c..437e1163164a 100644 --- a/numpy/polynomial/_polybase.py +++ b/numpy/polynomial/_polybase.py @@ -479,6 +479,7 @@ def __setstate__(self, dict): def __call__(self, arg): off, scl = pu.mapparms(self.domain, self.window) + arg = np.asarray(arg) arg = off + scl*arg return self._val(arg, self.coef) From 741b0becbd03934585210556df7478ceec24b000 Mon Sep 17 00:00:00 2001 From: christos val Date: Sun, 21 Mar 2021 19:51:03 -0400 Subject: [PATCH 2/2] add release note --- doc/release/upcoming_changes/18662.new_feature.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/release/upcoming_changes/18662.new_feature.rst diff --git a/doc/release/upcoming_changes/18662.new_feature.rst b/doc/release/upcoming_changes/18662.new_feature.rst new file mode 100644 index 000000000000..7adfcee79e1f --- /dev/null +++ b/doc/release/upcoming_changes/18662.new_feature.rst @@ -0,0 +1,5 @@ +Add support for array-likes in polynomial evaluation +---------------------------------------------------------------------------- + +Polynomial evaluation now accepts array-likes (e.g. lists) as its +input argument, in addition to NumPy arrays.