diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2019-04-14 23:02:20 +0200 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2019-04-14 23:09:35 +0200 |
commit | 418e3bf0789dcd7d064de55a266b186d4ab42774 (patch) | |
tree | 2eff356062ff9b523e748a452f6c515bfbecb12e /numpy/lib/polynomial.py | |
parent | 5343bc84bbbd36df73b4678d5f58c2cbcc1dda85 (diff) | |
download | numpy-418e3bf0789dcd7d064de55a266b186d4ab42774.tar.gz |
DOC: fix 4 remaining doc build warnings.
2 for polyfit rankwarning, 2 for divide by zero in log10.
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r-- | numpy/lib/polynomial.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 62f96f773..8c6f69cb0 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -548,6 +548,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): Examples -------- + >>> import warnings >>> x = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0]) >>> y = np.array([0.0, 0.8, 0.9, 0.1, -0.8, -1.0]) >>> z = np.polyfit(x, y, 3) @@ -566,9 +567,10 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): High-order polynomials may oscillate wildly: - >>> p30 = np.poly1d(np.polyfit(x, y, 30)) + >>> with warnings.catch_warnings(): + ... warnings.simplefilter('ignore', np.RankWarning) + ... p30 = np.poly1d(np.polyfit(x, y, 30)) ... - >>> # RankWarning: Polyfit may be poorly conditioned... >>> p30(4) -0.80000000000000204 # may vary >>> p30(5) |