Skip to content

Commit ac8f979

Browse files
authored
Merge pull request numpy#19905 from Samyak2/polynomial-fit-doc-formatting
DOC: fix docstring formatting of polynomial fit method return values.
2 parents b05798a + 89df711 commit ac8f979

File tree

8 files changed

+53
-47
lines changed

8 files changed

+53
-47
lines changed

numpy/lib/polynomial.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,19 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False):
510510
coefficients for `k`-th data set are in ``p[:,k]``.
511511
512512
residuals, rank, singular_values, rcond
513-
Present only if `full` = True. Residuals is sum of squared residuals
514-
of the least-squares fit, the effective rank of the scaled Vandermonde
515-
coefficient matrix, its singular values, and the specified value of
516-
`rcond`. For more details, see `linalg.lstsq`.
513+
These values are only returned if ``full == True``
514+
515+
- residuals -- sum of squared residuals of the least squares fit
516+
- rank -- the effective rank of the scaled Vandermonde
517+
coefficient matrix
518+
- singular_values -- singular values of the scaled Vandermonde
519+
coefficient matrix
520+
- rcond -- value of `rcond`.
521+
522+
For more details, see `numpy.linalg.lstsq`.
517523
518524
V : ndarray, shape (M,M) or (M,M,K)
519-
Present only if `full` = False and `cov`=True. The covariance
525+
Present only if ``full == False`` and ``cov == True``. The covariance
520526
matrix of the polynomial coefficient estimates. The diagonal of
521527
this matrix are the variance estimates for each coefficient. If y
522528
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):
527533
-----
528534
RankWarning
529535
The rank of the coefficient matrix in the least-squares fit is
530-
deficient. The warning is only raised if `full` = False.
536+
deficient. The warning is only raised if ``full == False``.
531537
532538
The warnings can be turned off by
533539

numpy/polynomial/_polybase.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,12 @@ class domain in NumPy 1.4 and ``None`` in later versions.
958958
of interest, do ``new_series.convert().coef``.
959959
960960
[resid, rank, sv, rcond] : list
961-
These values are only returned if `full` = True
961+
These values are only returned if ``full == True``
962962
963-
resid -- sum of squared residuals of the least squares fit
964-
rank -- the numerical rank of the scaled Vandermonde matrix
965-
sv -- singular values of the scaled Vandermonde matrix
966-
rcond -- value of `rcond`.
963+
- resid -- sum of squared residuals of the least squares fit
964+
- rank -- the numerical rank of the scaled Vandermonde matrix
965+
- sv -- singular values of the scaled Vandermonde matrix
966+
- rcond -- value of `rcond`.
967967
968968
For more details, see `linalg.lstsq`.
969969

numpy/polynomial/chebyshev.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,20 +1598,20 @@ def chebfit(x, y, deg, rcond=None, full=False, w=None):
15981598
`k`.
15991599
16001600
[residuals, rank, singular_values, rcond] : list
1601-
These values are only returned if `full` = True
1601+
These values are only returned if ``full == True``
16021602
1603-
resid -- sum of squared residuals of the least squares fit
1604-
rank -- the numerical rank of the scaled Vandermonde matrix
1605-
sv -- singular values of the scaled Vandermonde matrix
1606-
rcond -- value of `rcond`.
1603+
- residuals -- sum of squared residuals of the least squares fit
1604+
- rank -- the numerical rank of the scaled Vandermonde matrix
1605+
- singular_values -- singular values of the scaled Vandermonde matrix
1606+
- rcond -- value of `rcond`.
16071607
16081608
For more details, see `numpy.linalg.lstsq`.
16091609
16101610
Warns
16111611
-----
16121612
RankWarning
16131613
The rank of the coefficient matrix in the least-squares fit is
1614-
deficient. The warning is only raised if `full` = False. The
1614+
deficient. The warning is only raised if ``full == False``. The
16151615
warnings can be turned off by
16161616
16171617
>>> import warnings

numpy/polynomial/hermite.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,20 +1324,20 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None):
13241324
`k`.
13251325
13261326
[residuals, rank, singular_values, rcond] : list
1327-
These values are only returned if `full` = True
1327+
These values are only returned if ``full == True``
13281328
1329-
resid -- sum of squared residuals of the least squares fit
1330-
rank -- the numerical rank of the scaled Vandermonde matrix
1331-
sv -- singular values of the scaled Vandermonde matrix
1332-
rcond -- value of `rcond`.
1329+
- residuals -- sum of squared residuals of the least squares fit
1330+
- rank -- the numerical rank of the scaled Vandermonde matrix
1331+
- singular_values -- singular values of the scaled Vandermonde matrix
1332+
- rcond -- value of `rcond`.
13331333
13341334
For more details, see `numpy.linalg.lstsq`.
13351335
13361336
Warns
13371337
-----
13381338
RankWarning
13391339
The rank of the coefficient matrix in the least-squares fit is
1340-
deficient. The warning is only raised if `full` = False. The
1340+
deficient. The warning is only raised if ``full == False``. The
13411341
warnings can be turned off by
13421342
13431343
>>> import warnings

numpy/polynomial/hermite_e.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,20 +1315,20 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None):
13151315
`k`.
13161316
13171317
[residuals, rank, singular_values, rcond] : list
1318-
These values are only returned if `full` = True
1318+
These values are only returned if ``full == True``
13191319
1320-
resid -- sum of squared residuals of the least squares fit
1321-
rank -- the numerical rank of the scaled Vandermonde matrix
1322-
sv -- singular values of the scaled Vandermonde matrix
1323-
rcond -- value of `rcond`.
1320+
- residuals -- sum of squared residuals of the least squares fit
1321+
- rank -- the numerical rank of the scaled Vandermonde matrix
1322+
- singular_values -- singular values of the scaled Vandermonde matrix
1323+
- rcond -- value of `rcond`.
13241324
13251325
For more details, see `numpy.linalg.lstsq`.
13261326
13271327
Warns
13281328
-----
13291329
RankWarning
13301330
The rank of the coefficient matrix in the least-squares fit is
1331-
deficient. The warning is only raised if `full` = False. The
1331+
deficient. The warning is only raised if ``full = False``. The
13321332
warnings can be turned off by
13331333
13341334
>>> import warnings

numpy/polynomial/laguerre.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,20 +1321,20 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None):
13211321
`k`.
13221322
13231323
[residuals, rank, singular_values, rcond] : list
1324-
These values are only returned if `full` = True
1324+
These values are only returned if ``full == True``
13251325
1326-
resid -- sum of squared residuals of the least squares fit
1327-
rank -- the numerical rank of the scaled Vandermonde matrix
1328-
sv -- singular values of the scaled Vandermonde matrix
1329-
rcond -- value of `rcond`.
1326+
- residuals -- sum of squared residuals of the least squares fit
1327+
- rank -- the numerical rank of the scaled Vandermonde matrix
1328+
- singular_values -- singular values of the scaled Vandermonde matrix
1329+
- rcond -- value of `rcond`.
13301330
13311331
For more details, see `numpy.linalg.lstsq`.
13321332
13331333
Warns
13341334
-----
13351335
RankWarning
13361336
The rank of the coefficient matrix in the least-squares fit is
1337-
deficient. The warning is only raised if `full` = False. The
1337+
deficient. The warning is only raised if ``full == False``. The
13381338
warnings can be turned off by
13391339
13401340
>>> import warnings

numpy/polynomial/legendre.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,20 +1339,20 @@ def legfit(x, y, deg, rcond=None, full=False, w=None):
13391339
returned `coef`.
13401340
13411341
[residuals, rank, singular_values, rcond] : list
1342-
These values are only returned if `full` = True
1342+
These values are only returned if ``full == True``
13431343
1344-
resid -- sum of squared residuals of the least squares fit
1345-
rank -- the numerical rank of the scaled Vandermonde matrix
1346-
sv -- singular values of the scaled Vandermonde matrix
1347-
rcond -- value of `rcond`.
1344+
- residuals -- sum of squared residuals of the least squares fit
1345+
- rank -- the numerical rank of the scaled Vandermonde matrix
1346+
- singular_values -- singular values of the scaled Vandermonde matrix
1347+
- rcond -- value of `rcond`.
13481348
13491349
For more details, see `numpy.linalg.lstsq`.
13501350
13511351
Warns
13521352
-----
13531353
RankWarning
13541354
The rank of the coefficient matrix in the least-squares fit is
1355-
deficient. The warning is only raised if `full` = False. The
1355+
deficient. The warning is only raised if ``full == False``. The
13561356
warnings can be turned off by
13571357
13581358
>>> import warnings

numpy/polynomial/polynomial.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,20 +1268,20 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None):
12681268
fit to the data in `y`'s `k`-th column.
12691269
12701270
[residuals, rank, singular_values, rcond] : list
1271-
These values are only returned if `full` = True
1271+
These values are only returned if ``full == True``
12721272
1273-
resid -- sum of squared residuals of the least squares fit
1274-
rank -- the numerical rank of the scaled Vandermonde matrix
1275-
sv -- singular values of the scaled Vandermonde matrix
1276-
rcond -- value of `rcond`.
1273+
- residuals -- sum of squared residuals of the least squares fit
1274+
- rank -- the numerical rank of the scaled Vandermonde matrix
1275+
- singular_values -- singular values of the scaled Vandermonde matrix
1276+
- rcond -- value of `rcond`.
12771277
12781278
For more details, see `numpy.linalg.lstsq`.
12791279
12801280
Raises
12811281
------
12821282
RankWarning
12831283
Raised if the matrix in the least-squares fit is rank deficient.
1284-
The warning is only raised if `full` == False. The warnings can
1284+
The warning is only raised if ``full == False``. The warnings can
12851285
be turned off by:
12861286
12871287
>>> import warnings

0 commit comments

Comments
 (0)