diff options
author | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2019-01-04 10:02:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 10:02:41 -0500 |
commit | aef982e4482773e802cc0ef076bf5e76ff650cf9 (patch) | |
tree | d307bb118265aee51189674b3be14d5582e6e244 /numpy/lib/polynomial.py | |
parent | b60b58359eef967ce1e557fd8437a37b68330be9 (diff) | |
parent | af6cb03920f3ae62cb8a8c871edeccbcd8609955 (diff) | |
download | numpy-aef982e4482773e802cc0ef076bf5e76ff650cf9.tar.gz |
Merge pull request #12239 from daten-kieker/polyval_2477
BUG: polyval returned non-masked arrays for masked input.
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r-- | numpy/lib/polynomial.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 7904092ed..b55764b5d 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -704,6 +704,8 @@ def polyval(p, x): for polynomials of high degree the values may be inaccurate due to rounding errors. Use carefully. + If `x` is a subtype of `ndarray` the return value will be of the same type. + References ---------- .. [1] I. N. Bronshtein, K. A. Semendyayev, and K. A. Hirsch (Eng. @@ -726,7 +728,7 @@ def polyval(p, x): if isinstance(x, poly1d): y = 0 else: - x = NX.asarray(x) + x = NX.asanyarray(x) y = NX.zeros_like(x) for i in range(len(p)): y = y * x + p[i] |