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. 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)