summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSamyak S Sarnayak <samyak201@gmail.com>2021-09-20 19:44:24 +0530
committerSamyak S Sarnayak <samyak201@gmail.com>2021-09-21 13:48:08 +0530
commit89df711a83b1cb34457bd49c73085811dcf46783 (patch)
tree1b53334c252148561b9d501759bccd351e7a7732 /numpy
parentdf0b1bd75f0e8489912863d1f9dfde1846a7bf51 (diff)
downloadnumpy-89df711a83b1cb34457bd49c73085811dcf46783.tar.gz
DOC: fix formatting of a return value of polynomial fit methods
Fixes #19897 The 2nd return value of the following methods/functions were badly formatted and the list was all appearing in a single line. Changed them to separate points which are rendered nicely. - numpy.polyfit - numpy.ma.polyfit - numpy.polynomial.polynomial.polyfit - numpy.polynomial.polynomial.Polynomial.fit - numpy.polynomial.chebyshev.chebfit - numpy.polynomial.chebyshev.Chebyshev.fit - numpy.polynomial.hermite.hermfit - numpy.polynomial.hermite.Hermite.fit - numpy.polynomial.hermite_e.hermefit - numpy.polynomial.hermite_e.HermiteE.fit - numpy.polynomial.laguerre.lagfit - numpy.polynomial.laguerre.Laguerre.fit - numpy.polynomial.legendre.legfit - numpy.polynomial.legendre.Legendre.fit Also fixed erroneous links to `numpy.full` which were actually referring to the `full` argument. Changed those to code strings (double backticks) from single backticks. Also fixed formatting issues in the 3rd return value of numpy.polyfit (and hence also numpy.ma.polyfit).
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/polynomial.py18
-rw-r--r--numpy/polynomial/_polybase.py10
-rw-r--r--numpy/polynomial/chebyshev.py12
-rw-r--r--numpy/polynomial/hermite.py12
-rw-r--r--numpy/polynomial/hermite_e.py12
-rw-r--r--numpy/polynomial/laguerre.py12
-rw-r--r--numpy/polynomial/legendre.py12
-rw-r--r--numpy/polynomial/polynomial.py12
8 files changed, 53 insertions, 47 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index c40e50a57..1cbb3cd88 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -510,13 +510,19 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False):
coefficients for `k`-th data set are in ``p[:,k]``.
residuals, rank, singular_values, rcond
- Present only if `full` = True. Residuals is sum of squared residuals
- of the least-squares fit, the effective rank of the scaled Vandermonde
- coefficient matrix, its singular values, and the specified value of
- `rcond`. For more details, see `linalg.lstsq`.
+ These values are only returned if ``full == True``
+
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the effective rank of the scaled Vandermonde
+ coefficient matrix
+ - singular_values -- singular values of the scaled Vandermonde
+ coefficient matrix
+ - rcond -- value of `rcond`.
+
+ For more details, see `numpy.linalg.lstsq`.
V : ndarray, shape (M,M) or (M,M,K)
- Present only if `full` = False and `cov`=True. The covariance
+ Present only if ``full == False`` and ``cov == True``. The covariance
matrix of the polynomial coefficient estimates. The diagonal of
this matrix are the variance estimates for each coefficient. If y
is a 2-D array, then the covariance matrix for the `k`-th data set
@@ -527,7 +533,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False):
-----
RankWarning
The rank of the coefficient matrix in the least-squares fit is
- deficient. The warning is only raised if `full` = False.
+ deficient. The warning is only raised if ``full == False``.
The warnings can be turned off by
diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py
index 5525b232b..8a72af278 100644
--- a/numpy/polynomial/_polybase.py
+++ b/numpy/polynomial/_polybase.py
@@ -958,12 +958,12 @@ class ABCPolyBase(abc.ABC):
of interest, do ``new_series.convert().coef``.
[resid, rank, sv, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - resid -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - sv -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `linalg.lstsq`.
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index 210000ec4..97271a8a0 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -1598,12 +1598,12 @@ def chebfit(x, y, deg, rcond=None, full=False, w=None):
`k`.
[residuals, rank, singular_values, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - singular_values -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `numpy.linalg.lstsq`.
@@ -1611,7 +1611,7 @@ def chebfit(x, y, deg, rcond=None, full=False, w=None):
-----
RankWarning
The rank of the coefficient matrix in the least-squares fit is
- deficient. The warning is only raised if `full` = False. The
+ deficient. The warning is only raised if ``full == False``. The
warnings can be turned off by
>>> import warnings
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index c1b9f71c0..9800063f0 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -1324,12 +1324,12 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None):
`k`.
[residuals, rank, singular_values, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - singular_values -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `numpy.linalg.lstsq`.
@@ -1337,7 +1337,7 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None):
-----
RankWarning
The rank of the coefficient matrix in the least-squares fit is
- deficient. The warning is only raised if `full` = False. The
+ deficient. The warning is only raised if ``full == False``. The
warnings can be turned off by
>>> import warnings
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index b7095c910..abd27361e 100644
--- a/numpy/polynomial/hermite_e.py
+++ b/numpy/polynomial/hermite_e.py
@@ -1315,12 +1315,12 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None):
`k`.
[residuals, rank, singular_values, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - singular_values -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `numpy.linalg.lstsq`.
@@ -1328,7 +1328,7 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None):
-----
RankWarning
The rank of the coefficient matrix in the least-squares fit is
- deficient. The warning is only raised if `full` = False. The
+ deficient. The warning is only raised if ``full = False``. The
warnings can be turned off by
>>> import warnings
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index d3b6432dc..e46d29ed5 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -1321,12 +1321,12 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None):
`k`.
[residuals, rank, singular_values, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - singular_values -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `numpy.linalg.lstsq`.
@@ -1334,7 +1334,7 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None):
-----
RankWarning
The rank of the coefficient matrix in the least-squares fit is
- deficient. The warning is only raised if `full` = False. The
+ deficient. The warning is only raised if ``full == False``. The
warnings can be turned off by
>>> import warnings
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index d4cf4accf..9faad96e2 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -1339,12 +1339,12 @@ def legfit(x, y, deg, rcond=None, full=False, w=None):
returned `coef`.
[residuals, rank, singular_values, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - singular_values -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `numpy.linalg.lstsq`.
@@ -1352,7 +1352,7 @@ def legfit(x, y, deg, rcond=None, full=False, w=None):
-----
RankWarning
The rank of the coefficient matrix in the least-squares fit is
- deficient. The warning is only raised if `full` = False. The
+ deficient. The warning is only raised if ``full == False``. The
warnings can be turned off by
>>> import warnings
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index d8a032068..2fead88ab 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -1268,12 +1268,12 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None):
fit to the data in `y`'s `k`-th column.
[residuals, rank, singular_values, rcond] : list
- These values are only returned if `full` = True
+ These values are only returned if ``full == True``
- resid -- sum of squared residuals of the least squares fit
- rank -- the numerical rank of the scaled Vandermonde matrix
- sv -- singular values of the scaled Vandermonde matrix
- rcond -- value of `rcond`.
+ - residuals -- sum of squared residuals of the least squares fit
+ - rank -- the numerical rank of the scaled Vandermonde matrix
+ - singular_values -- singular values of the scaled Vandermonde matrix
+ - rcond -- value of `rcond`.
For more details, see `numpy.linalg.lstsq`.
@@ -1281,7 +1281,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None):
------
RankWarning
Raised if the matrix in the least-squares fit is rank deficient.
- The warning is only raised if `full` == False. The warnings can
+ The warning is only raised if ``full == False``. The warnings can
be turned off by:
>>> import warnings