From 4a0c307b1af162c4e3363a8b4c90fa1a138adebf Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Tue, 14 Aug 2018 18:01:20 -0700 Subject: DOC: recommend polynomial.Polynomial over np.polyfit (#11733) * DOC: reccomend polynomail.Polynomial over np.polyfit * update from review * update from review, fix links * fix from review --- numpy/lib/polynomial.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'numpy/lib/polynomial.py') diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 0e691f56e..0de39877a 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -396,7 +396,12 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): Fit a polynomial ``p(x) = p[0] * x**deg + ... + p[deg]`` of degree `deg` to points `(x, y)`. Returns a vector of coefficients `p` that minimises - the squared error. + the squared error in the order `deg`, `deg-1`, ... `0`. + + The `Polynomial.fit ` class + method is recommended for new code as it is more stable numerically. See + the documentation for the method for more information, or the convenience + function `polynomial.polyfit `. Parameters ---------- -- cgit v1.2.1 From fdf284c29b241bda33be8bba3f667d3ac86fdc14 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Wed, 15 Aug 2018 08:04:59 -0600 Subject: DOC: Small docstring fixes for old polyfit. * Remove misleading reference to numpy/polynomial/polynomial/polyfit. * Add missing period in numpy/polynomial/_polybase.py --- numpy/lib/polynomial.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/lib/polynomial.py') diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 0de39877a..9f3b84732 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -400,8 +400,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): The `Polynomial.fit ` class method is recommended for new code as it is more stable numerically. See - the documentation for the method for more information, or the convenience - function `polynomial.polyfit `. + the documentation of the method for more information. Parameters ---------- -- cgit v1.2.1