diff options
author | czgdp1807 <gdp.1807@gmail.com> | 2021-06-09 15:42:28 +0530 |
---|---|---|
committer | czgdp1807 <gdp.1807@gmail.com> | 2021-06-09 15:42:28 +0530 |
commit | ab01330d16ec77c2bc232ce696ce3ab2be9e51d0 (patch) | |
tree | 95e5ec28afe5c5484df97e0348b0484e865a4b7e | |
parent | 3268a48ba4c0e7ae97dc358fa85e7c1b09d7cb21 (diff) | |
parent | b9a63f5052b0ba5a7a5b2616ddcc1754df177bd3 (diff) | |
download | numpy-ab01330d16ec77c2bc232ce696ce3ab2be9e51d0.tar.gz |
Merge branch 'main' into never_copy
-rw-r--r-- | doc/RELEASE_WALKTHROUGH.rst.txt | 4 | ||||
-rw-r--r-- | doc/source/conf.py | 1 | ||||
-rw-r--r-- | doc/source/user/how-to-how-to.rst | 5 | ||||
-rw-r--r-- | numpy/lib/polynomial.py | 9 | ||||
-rw-r--r-- | numpy/polynomial/_polybase.py | 10 | ||||
-rw-r--r-- | numpy/polynomial/chebyshev.py | 9 | ||||
-rw-r--r-- | numpy/polynomial/hermite.py | 9 | ||||
-rw-r--r-- | numpy/polynomial/hermite_e.py | 9 | ||||
-rw-r--r-- | numpy/polynomial/laguerre.py | 9 | ||||
-rw-r--r-- | numpy/polynomial/legendre.py | 9 | ||||
-rw-r--r-- | numpy/polynomial/polynomial.py | 9 |
11 files changed, 45 insertions, 38 deletions
diff --git a/doc/RELEASE_WALKTHROUGH.rst.txt b/doc/RELEASE_WALKTHROUGH.rst.txt index 4fbc7af1c..6febd554f 100644 --- a/doc/RELEASE_WALKTHROUGH.rst.txt +++ b/doc/RELEASE_WALKTHROUGH.rst.txt @@ -102,8 +102,8 @@ someone else, then create a new branch for the series. If the branch already exists skip this:: $ cd ../numpy-wheels - $ git co master - $ git pull upstream master + $ git checkout main + $ git pull upstream main $ git branch v1.19.x Checkout the new branch and edit the ``azure-pipelines.yml`` and diff --git a/doc/source/conf.py b/doc/source/conf.py index 5ba7f70b8..a49074922 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -295,6 +295,7 @@ intersphinx_mapping = { 'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None), 'scipy-lecture-notes': ('https://scipy-lectures.org', None), 'pytest': ('https://docs.pytest.org/en/stable', None), + 'numpy-tutorials': ('https://numpy.org/numpy-tutorials', None), } diff --git a/doc/source/user/how-to-how-to.rst b/doc/source/user/how-to-how-to.rst index 16a2fc7a4..13d2b405f 100644 --- a/doc/source/user/how-to-how-to.rst +++ b/doc/source/user/how-to-how-to.rst @@ -105,10 +105,7 @@ deep dives intended to give understanding rather than immediate assistance, and `References`, which give complete, autoritative data on some concrete part of NumPy (like its API) but aren't obligated to paint a broader picture. -For more on tutorials, see the `tutorial how-to`_. - -.. _`tutorial how-to`: https://github.com/numpy/numpy-tutorials/blob/master/tutorial_style.ipynb - +For more on tutorials, see :doc:`content/tutorial-style-guide` ****************************************************************************** Is this page an example of a how-to? diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 56fcce621..23021cafa 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -489,8 +489,11 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (M,), optional - Weights to apply to the y-coordinates of the sample points. For - gaussian uncertainties, use 1/sigma (not 1/sigma**2). + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. cov : bool or str, optional If given and not `False`, return not just the estimate but also its covariance matrix. By default, the covariance are scaled by @@ -498,7 +501,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): to be unreliable except in a relative sense and everything is scaled such that the reduced chi2 is unity. This scaling is omitted if ``cov='unscaled'``, as is relevant for the case that the weights are - 1/sigma**2, with sigma known to be a reliable estimate of the + w = 1/sigma, with sigma known to be a reliable estimate of the uncertainty. Returns diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py index b04b8e66b..5525b232b 100644 --- a/numpy/polynomial/_polybase.py +++ b/numpy/polynomial/_polybase.py @@ -936,11 +936,11 @@ class ABCPolyBase(abc.ABC): diagnostic information from the singular value decomposition is also returned. w : array_like, shape (M,), optional - Weights. If not None the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products - ``w[i]*y[i]`` all have the same variance. The default value is - None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have + the same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. .. versionadded:: 1.5.0 window : {[beg, end]}, optional diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py index d24fc738f..210000ec4 100644 --- a/numpy/polynomial/chebyshev.py +++ b/numpy/polynomial/chebyshev.py @@ -1582,10 +1582,11 @@ def chebfit(x, y, deg, rcond=None, full=False, w=None): default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (`M`,), optional - Weights. If not None, the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products ``w[i]*y[i]`` - all have the same variance. The default value is None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. .. versionadded:: 1.5.0 diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py index eef5c25b2..c1b9f71c0 100644 --- a/numpy/polynomial/hermite.py +++ b/numpy/polynomial/hermite.py @@ -1310,10 +1310,11 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None): default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (`M`,), optional - Weights. If not None, the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products ``w[i]*y[i]`` - all have the same variance. The default value is None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. Returns ------- diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py index 05d1337b0..b7095c910 100644 --- a/numpy/polynomial/hermite_e.py +++ b/numpy/polynomial/hermite_e.py @@ -1301,10 +1301,11 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None): default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (`M`,), optional - Weights. If not None, the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products ``w[i]*y[i]`` - all have the same variance. The default value is None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. Returns ------- diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py index 69d557510..d3b6432dc 100644 --- a/numpy/polynomial/laguerre.py +++ b/numpy/polynomial/laguerre.py @@ -1307,10 +1307,11 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None): default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (`M`,), optional - Weights. If not None, the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products ``w[i]*y[i]`` - all have the same variance. The default value is None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. Returns ------- diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index cd4da2a79..d4cf4accf 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -1321,10 +1321,11 @@ def legfit(x, y, deg, rcond=None, full=False, w=None): default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned. w : array_like, shape (`M`,), optional - Weights. If not None, the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products ``w[i]*y[i]`` - all have the same variance. The default value is None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. .. versionadded:: 1.5.0 diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index 940eed5e3..d8a032068 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -1252,10 +1252,11 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None): diagnostic information from the singular value decomposition (used to solve the fit's matrix equation) is also returned. w : array_like, shape (`M`,), optional - Weights. If not None, the contribution of each point - ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the - weights are chosen so that the errors of the products ``w[i]*y[i]`` - all have the same variance. The default value is None. + Weights. If not None, the weight ``w[i]`` applies to the unsquared + residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are + chosen so that the errors of the products ``w[i]*y[i]`` all have the + same variance. When using inverse-variance weighting, use + ``w[i] = 1/sigma(y[i])``. The default value is None. .. versionadded:: 1.5.0 |