summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2018-08-14 18:01:20 -0700
committerCharles Harris <charlesr.harris@gmail.com>2018-08-14 20:01:20 -0500
commit4a0c307b1af162c4e3363a8b4c90fa1a138adebf (patch)
treee7e8d8d6ce98051d897f12ebe190a09b855bf54e /numpy
parente759594d126ccfa16b871e1d484b52e36bffd001 (diff)
downloadnumpy-4a0c307b1af162c4e3363a8b4c90fa1a138adebf.tar.gz
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
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/polynomial.py7
-rw-r--r--numpy/polynomial/_polybase.py4
2 files changed, 9 insertions, 2 deletions
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 <numpy.polynomial.polynomial.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 <numpy.polynomial.polynomial.polyfit>`.
Parameters
----------
diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py
index 9f4d30e53..98f16836c 100644
--- a/numpy/polynomial/_polybase.py
+++ b/numpy/polynomial/_polybase.py
@@ -860,7 +860,9 @@ class ABCPolyBase(object):
-------
new_series : series
A series that represents the least squares fit to the data and
- has the domain specified in the call.
+ has the domain and window specified in the call. If the
+ coefficients for the unscaled and unshifted basis polynomials are
+ of interest, do ``new_series.convert().coef``
[resid, rank, sv, rcond] : list
These values are only returned if `full` = True