diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-04-15 21:05:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 21:05:17 +0300 |
commit | cc94f360febdef0e6c4183c50555ba82e60ccff6 (patch) | |
tree | e731b26d575865ca3f0667df4249e23218a46e5c | |
parent | 741c8b4dc95e4fa8a2ba0d003611c9c874ec9cab (diff) | |
parent | 26a8b418a9e19437d76b00be8a0a4f32aee68c4b (diff) | |
download | numpy-cc94f360febdef0e6c4183c50555ba82e60ccff6.tar.gz |
Merge pull request #13331 from rgommers/fix-docs
DOC, BLD: fix doc build issues in preparation for the next numpydoc release
-rw-r--r-- | numpy/core/_add_newdocs.py | 208 | ||||
-rw-r--r-- | numpy/core/fromnumeric.py | 2 | ||||
-rw-r--r-- | numpy/core/numerictypes.py | 2 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 68 | ||||
-rw-r--r-- | numpy/lib/polynomial.py | 15 | ||||
-rw-r--r-- | numpy/ma/extras.py | 12 | ||||
-rw-r--r-- | numpy/polynomial/chebyshev.py | 7 | ||||
-rw-r--r-- | numpy/polynomial/hermite.py | 7 | ||||
-rw-r--r-- | numpy/polynomial/hermite_e.py | 7 | ||||
-rw-r--r-- | numpy/polynomial/laguerre.py | 7 | ||||
-rw-r--r-- | numpy/polynomial/legendre.py | 7 | ||||
-rw-r--r-- | numpy/polynomial/polynomial.py | 4 |
12 files changed, 122 insertions, 224 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py index 8855e00f2..c023f0526 100644 --- a/numpy/core/_add_newdocs.py +++ b/numpy/core/_add_newdocs.py @@ -5884,9 +5884,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('T', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -5898,9 +5896,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('base', albeit unimplemented, all the attributes of the ndarray class so as to a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -5950,9 +5946,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('all', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -5964,9 +5958,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('any', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -5978,9 +5970,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('argmax', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -5992,9 +5982,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('argmin', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6006,9 +5994,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('argsort', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6020,9 +6006,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('astype', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6034,9 +6018,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('byteswap', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6048,9 +6030,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('choose', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6062,9 +6042,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('clip', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6076,9 +6054,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('compress', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6090,9 +6066,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('conjugate', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6104,9 +6078,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('copy', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6118,9 +6090,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('cumprod', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6132,9 +6102,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('cumsum', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6146,9 +6114,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('diagonal', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6160,9 +6126,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('dump', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6174,9 +6138,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('dumps', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6188,9 +6150,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('fill', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6202,9 +6162,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('flatten', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6216,9 +6174,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('getfield', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6230,9 +6186,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('item', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6244,9 +6198,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('itemset', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6258,9 +6210,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('max', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6272,9 +6222,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('mean', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6286,9 +6234,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('min', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6333,9 +6279,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('nonzero', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6347,9 +6291,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('prod', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6361,9 +6303,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('ptp', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6375,9 +6315,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('put', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6389,9 +6327,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('ravel', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6403,9 +6339,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('repeat', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6417,9 +6351,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('reshape', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6431,9 +6363,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('resize', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6445,9 +6375,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('round', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6459,9 +6387,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('searchsorted', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6473,9 +6399,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('setfield', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6487,9 +6411,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('setflags', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6501,9 +6423,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('sort', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6515,9 +6435,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('squeeze', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6529,9 +6447,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('std', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6543,9 +6459,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('sum', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6557,9 +6471,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('swapaxes', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6571,9 +6483,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('take', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6585,9 +6495,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('tofile', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6599,9 +6507,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('tolist', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6613,9 +6519,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('tostring', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6627,9 +6531,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('trace', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6641,9 +6543,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('transpose', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6655,9 +6555,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('var', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) @@ -6669,9 +6567,7 @@ add_newdoc('numpy.core.numerictypes', 'generic', ('view', albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. - See Also - -------- - The corresponding attribute of the derived class of interest. + See also the corresponding attribute of the derived class of interest. """)) diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 801ef972d..b4d721940 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -3406,7 +3406,7 @@ def var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue): See Also -------- - std , mean, nanmean, nanstd, nanvar + std, mean, nanmean, nanstd, nanvar numpy.doc.ufuncs : Section "Output arguments" Notes diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py index 70cc484b1..3ec8235db 100644 --- a/numpy/core/numerictypes.py +++ b/numpy/core/numerictypes.py @@ -347,7 +347,7 @@ def issubsctype(arg1, arg2): See Also -------- - issctype, issubdtype,obj2sctype + issctype, issubdtype, obj2sctype Examples -------- diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index fb40ef927..e9908d1ef 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -377,7 +377,7 @@ def average(a, axis=None, weights=None, returned=False): Traceback (most recent call last): ... TypeError: Axis must be specified when shapes of a and weights differ. - + >>> a = np.ones(5, dtype=np.float128) >>> w = np.ones(5, dtype=np.complex64) >>> avg = np.average(a, weights=w) @@ -1431,7 +1431,7 @@ def angle(z, deg=False): angle : ndarray or scalar The counterclockwise angle from the positive real axis on the complex plane, with dtype as numpy.float64. - + ..versionchanged:: 1.16.0 This function works on subclasses of ndarray like `ma.array`. @@ -1929,6 +1929,30 @@ class vectorize(object): vectorized : callable Vectorized function. + See Also + -------- + frompyfunc : Takes an arbitrary Python function and returns a ufunc + + Notes + ----- + The `vectorize` function is provided primarily for convenience, not for + performance. The implementation is essentially a for loop. + + If `otypes` is not specified, then a call to the function with the + first argument will be used to determine the number of outputs. The + results of this call will be cached if `cache` is `True` to prevent + calling the function twice. However, to implement the cache, the + original function must be wrapped which will slow down subsequent + calls, so only do this if your function is expensive. + + The new keyword argument interface and `excluded` argument support + further degrades performance. + + References + ---------- + .. [1] NumPy Reference, section `Generalized Universal Function API + <https://docs.scipy.org/doc/numpy/reference/c-api.generalized-ufuncs.html>`_. + Examples -------- >>> def myfunc(a, b): @@ -1988,8 +2012,8 @@ class vectorize(object): >>> import scipy.stats >>> pearsonr = np.vectorize(scipy.stats.pearsonr, - ... signature='(n),(n)->(),()') - >>> pearsonr([[0, 1, 2, 3]], [[1, 2, 3, 4], [4, 3, 2, 1]]) + ... signature='(n),(n)->(),()') + >>> pearsonr([[0, 1, 2, 3]], [[1, 2, 3, 4], [4, 3, 2, 1]]) (array([ 1., -1.]), array([ 0., 0.])) Or for a vectorized convolution: @@ -2001,31 +2025,7 @@ class vectorize(object): [0., 0., 1., 2., 1., 0.], [0., 0., 0., 1., 2., 1.]]) - See Also - -------- - frompyfunc : Takes an arbitrary Python function and returns a ufunc - - Notes - ----- - The `vectorize` function is provided primarily for convenience, not for - performance. The implementation is essentially a for loop. - - If `otypes` is not specified, then a call to the function with the - first argument will be used to determine the number of outputs. The - results of this call will be cached if `cache` is `True` to prevent - calling the function twice. However, to implement the cache, the - original function must be wrapped which will slow down subsequent - calls, so only do this if your function is expensive. - - The new keyword argument interface and `excluded` argument support - further degrades performance. - - References - ---------- - .. [1] NumPy Reference, section `Generalized Universal Function API - <https://docs.scipy.org/doc/numpy/reference/c-api.generalized-ufuncs.html>`_. """ - def __init__(self, pyfunc, otypes=None, doc=None, excluded=None, cache=False, signature=None): self.pyfunc = pyfunc @@ -2618,7 +2618,9 @@ def blackman(M): >>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) - >>> response = 20 * np.log10(mag) + >>> with np.errstate(divide='ignore', invalid='ignore'): + ... response = 20 * np.log10(mag) + ... >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [<matplotlib.lines.Line2D object at 0x...>] @@ -2725,7 +2727,9 @@ def bartlett(M): >>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) - >>> response = 20 * np.log10(mag) + >>> with np.errstate(divide='ignore', invalid='ignore'): + ... response = 20 * np.log10(mag) + ... >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [<matplotlib.lines.Line2D object at 0x...>] @@ -2826,7 +2830,9 @@ def hanning(M): >>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) - >>> response = 20 * np.log10(mag) + >>> with np.errstate(divide='ignore', invalid='ignore'): + ... response = 20 * np.log10(mag) + ... >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [<matplotlib.lines.Line2D object at 0x...>] diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index b55764b5d..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)) - ... - >>> # RankWarning: Polyfit may be poorly conditioned... + >>> with warnings.catch_warnings(): + ... warnings.simplefilter('ignore', np.RankWarning) + ... p30 = np.poly1d(np.polyfit(x, y, 30)) + ... >>> p30(4) -0.80000000000000204 # may vary >>> p30(5) @@ -632,7 +634,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): # warn on rank reduction, which indicates an ill conditioned matrix if rank != order and not full: msg = "Polyfit may be poorly conditioned" - warnings.warn(msg, RankWarning, stacklevel=2) + warnings.warn(msg, RankWarning, stacklevel=3) if full: return c, resids, rank, s, rcond @@ -874,8 +876,7 @@ def polymul(a1, a2): See Also -------- poly1d : A one-dimensional polynomial class. - poly, polyadd, polyder, polydiv, polyfit, polyint, polysub, - polyval + poly, polyadd, polyder, polydiv, polyfit, polyint, polysub, polyval convolve : Array convolution. Same output as polymul, but has parameter for overlap mode. @@ -937,7 +938,7 @@ def polydiv(u, v): See Also -------- - poly, polyadd, polyder, polydiv, polyfit, polyint, polymul, polysub, + poly, polyadd, polyder, polydiv, polyfit, polyint, polymul, polysub polyval Notes diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index a51d83578..639b3dd1f 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -1532,7 +1532,7 @@ def flatnotmasked_edges(a): See Also -------- - flatnotmasked_contiguous, notmasked_contiguous, notmasked_edges, + flatnotmasked_contiguous, notmasked_contiguous, notmasked_edges clump_masked, clump_unmasked Notes @@ -1593,7 +1593,7 @@ def notmasked_edges(a, axis=None): See Also -------- - flatnotmasked_contiguous, flatnotmasked_edges, notmasked_contiguous, + flatnotmasked_contiguous, flatnotmasked_edges, notmasked_contiguous clump_masked, clump_unmasked Examples @@ -1638,7 +1638,7 @@ def flatnotmasked_contiguous(a): See Also -------- - flatnotmasked_edges, notmasked_contiguous, notmasked_edges, + flatnotmasked_edges, notmasked_contiguous, notmasked_edges clump_masked, clump_unmasked Notes @@ -1698,7 +1698,7 @@ def notmasked_contiguous(a, axis=None): See Also -------- - flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges, + flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges clump_masked, clump_unmasked Notes @@ -1803,7 +1803,7 @@ def clump_unmasked(a): See Also -------- - flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges, + flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges notmasked_contiguous, clump_masked Examples @@ -1842,7 +1842,7 @@ def clump_masked(a): See Also -------- - flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges, + flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges notmasked_contiguous, clump_unmasked Examples diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py index c37b2c6d6..e4d10bcb8 100644 --- a/numpy/polynomial/chebyshev.py +++ b/numpy/polynomial/chebyshev.py @@ -528,8 +528,7 @@ def chebfromroots(roots): See Also -------- - polyfromroots, legfromroots, lagfromroots, hermfromroots, - hermefromroots. + polyfromroots, legfromroots, lagfromroots, hermfromroots, hermefromroots Examples -------- @@ -1461,7 +1460,7 @@ def chebvander2d(x, y, deg): See Also -------- - chebvander, chebvander3d. chebval2d, chebval3d + chebvander, chebvander3d, chebval2d, chebval3d Notes ----- @@ -1515,7 +1514,7 @@ def chebvander3d(x, y, z, deg): See Also -------- - chebvander, chebvander3d. chebval2d, chebval3d + chebvander, chebvander3d, chebval2d, chebval3d Notes ----- diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py index 3870d1054..4bfd89e52 100644 --- a/numpy/polynomial/hermite.py +++ b/numpy/polynomial/hermite.py @@ -272,8 +272,7 @@ def hermfromroots(roots): See Also -------- - polyfromroots, legfromroots, lagfromroots, chebfromroots, - hermefromroots. + polyfromroots, legfromroots, lagfromroots, chebfromroots, hermefromroots Examples -------- @@ -1186,7 +1185,7 @@ def hermvander2d(x, y, deg): See Also -------- - hermvander, hermvander3d. hermval2d, hermval3d + hermvander, hermvander3d, hermval2d, hermval3d Notes ----- @@ -1240,7 +1239,7 @@ def hermvander3d(x, y, z, deg): See Also -------- - hermvander, hermvander3d. hermval2d, hermval3d + hermvander, hermvander3d, hermval2d, hermval3d Notes ----- diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py index b12c0d792..735d66e6c 100644 --- a/numpy/polynomial/hermite_e.py +++ b/numpy/polynomial/hermite_e.py @@ -273,8 +273,7 @@ def hermefromroots(roots): See Also -------- - polyfromroots, legfromroots, lagfromroots, hermfromroots, - chebfromroots. + polyfromroots, legfromroots, lagfromroots, hermfromroots, chebfromroots Examples -------- @@ -1179,7 +1178,7 @@ def hermevander2d(x, y, deg): See Also -------- - hermevander, hermevander3d. hermeval2d, hermeval3d + hermevander, hermevander3d, hermeval2d, hermeval3d Notes ----- @@ -1233,7 +1232,7 @@ def hermevander3d(x, y, z, deg): See Also -------- - hermevander, hermevander3d. hermeval2d, hermeval3d + hermevander, hermevander3d, hermeval2d, hermeval3d Notes ----- diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py index e103dde92..025a09929 100644 --- a/numpy/polynomial/laguerre.py +++ b/numpy/polynomial/laguerre.py @@ -269,8 +269,7 @@ def lagfromroots(roots): See Also -------- - polyfromroots, legfromroots, chebfromroots, hermfromroots, - hermefromroots. + polyfromroots, legfromroots, chebfromroots, hermfromroots, hermefromroots Examples -------- @@ -1186,7 +1185,7 @@ def lagvander2d(x, y, deg): See Also -------- - lagvander, lagvander3d. lagval2d, lagval3d + lagvander, lagvander3d, lagval2d, lagval3d Notes ----- @@ -1240,7 +1239,7 @@ def lagvander3d(x, y, z, deg): See Also -------- - lagvander, lagvander3d. lagval2d, lagval3d + lagvander, lagvander3d, lagval2d, lagval3d Notes ----- diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index 9eec9740d..f06b294cf 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -301,8 +301,7 @@ def legfromroots(roots): See Also -------- - polyfromroots, chebfromroots, lagfromroots, hermfromroots, - hermefromroots. + polyfromroots, chebfromroots, lagfromroots, hermfromroots, hermefromroots Examples -------- @@ -1222,7 +1221,7 @@ def legvander2d(x, y, deg): See Also -------- - legvander, legvander3d. legval2d, legval3d + legvander, legvander3d, legval2d, legval3d Notes ----- @@ -1276,7 +1275,7 @@ def legvander3d(x, y, z, deg): See Also -------- - legvander, legvander3d. legval2d, legval3d + legvander, legvander3d, legval2d, legval3d Notes ----- diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index afa330502..99f9fc2fd 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -1130,7 +1130,7 @@ def polyvander2d(x, y, deg): See Also -------- - polyvander, polyvander3d. polyval2d, polyval3d + polyvander, polyvander3d, polyval2d, polyval3d """ return pu._vander2d(polyvander, x, y, deg) @@ -1179,7 +1179,7 @@ def polyvander3d(x, y, z, deg): See Also -------- - polyvander, polyvander3d. polyval2d, polyval3d + polyvander, polyvander3d, polyval2d, polyval3d Notes ----- |