diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2022-04-07 01:02:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-07 01:02:24 -0600 |
| commit | 28e624d1e78ee46d7040e6a099bda39d7fa60e3d (patch) | |
| tree | a06138bca035d10cab34ddd950fdbf8ff7d464d0 /numpy/lib | |
| parent | ca85c17e712c93717abb5c2b921393c3ecfc47c4 (diff) | |
| parent | 782fdec661e8ba24f31a1b8886ec9a0a4301efd2 (diff) | |
| download | numpy-28e624d1e78ee46d7040e6a099bda39d7fa60e3d.tar.gz | |
Merge pull request #21291 from oscargus/spaceandcos
DOC: Add space after argument name
Diffstat (limited to 'numpy/lib')
| -rw-r--r-- | numpy/lib/format.py | 8 | ||||
| -rw-r--r-- | numpy/lib/function_base.py | 47 | ||||
| -rw-r--r-- | numpy/lib/npyio.py | 8 |
3 files changed, 31 insertions, 32 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py index 3967b43ee..264fff8d6 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -421,10 +421,10 @@ def _write_array_header(fp, d, version=None): d : dict This has the appropriate entries for writing its string representation to the header of the file. - version: tuple or None - None means use oldest that works - explicit version will raise a ValueError if the format does not - allow saving this data. Default: None + version : tuple or None + None means use oldest that works. Providing an explicit version will + raise a ValueError if the format does not allow saving this data. + Default: None """ header = ["{"] for key, value in sorted(d.items()): diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index f69604d6e..d611dd225 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -168,7 +168,7 @@ def rot90(m, k=1, axes=(0, 1)): Array of two or more dimensions. k : integer Number of times the array is rotated by 90 degrees. - axes: (2,) array_like + axes : (2,) array_like The array is rotated in the plane defined by the axes. Axes must be different. @@ -1656,7 +1656,7 @@ def unwrap(p, discont=None, axis=-1, *, period=2*pi): larger than ``period/2``. axis : int, optional Axis along which unwrap will operate, default is the last axis. - period: float, optional + period : float, optional Size of the range over which the input wraps. By default, it is ``2 pi``. @@ -2974,15 +2974,14 @@ def bartlett(M): \\frac{M-1}{2} - \\left|n - \\frac{M-1}{2}\\right| \\right) - Most references to the Bartlett window come from the signal - processing literature, where it is used as one of many windowing - functions for smoothing values. Note that convolution with this - window produces linear interpolation. It is also known as an - apodization (which means"removing the foot", i.e. smoothing - discontinuities at the beginning and end of the sampled signal) or - tapering function. The fourier transform of the Bartlett is the product - of two sinc functions. - Note the excellent discussion in Kanasewich. + Most references to the Bartlett window come from the signal processing + literature, where it is used as one of many windowing functions for + smoothing values. Note that convolution with this window produces linear + interpolation. It is also known as an apodization (which means "removing + the foot", i.e. smoothing discontinuities at the beginning and end of the + sampled signal) or tapering function. The Fourier transform of the + Bartlett window is the product of two sinc functions. Note the excellent + discussion in Kanasewich [2]_. References ---------- @@ -3075,7 +3074,7 @@ def hanning(M): ----- The Hanning window is defined as - .. math:: w(n) = 0.5 - 0.5cos\\left(\\frac{2\\pi{n}}{M-1}\\right) + .. math:: w(n) = 0.5 - 0.5\\cos\\left(\\frac{2\\pi{n}}{M-1}\\right) \\qquad 0 \\leq n \\leq M-1 The Hanning was named for Julius von Hann, an Austrian meteorologist. @@ -3179,7 +3178,7 @@ def hamming(M): ----- The Hamming window is defined as - .. math:: w(n) = 0.54 - 0.46cos\\left(\\frac{2\\pi{n}}{M-1}\\right) + .. math:: w(n) = 0.54 - 0.46\\cos\\left(\\frac{2\\pi{n}}{M-1}\\right) \\qquad 0 \\leq n \\leq M-1 The Hamming was named for R. W. Hamming, an associate of J. W. Tukey @@ -4731,10 +4730,10 @@ def trapz(y, x=None, dx=1.0, axis=-1): Returns ------- trapz : float or ndarray - Definite integral of 'y' = n-dimensional array as approximated along - a single axis by the trapezoidal rule. If 'y' is a 1-dimensional array, - then the result is a float. If 'n' is greater than 1, then the result - is an 'n-1' dimensional array. + Definite integral of `y` = n-dimensional array as approximated along + a single axis by the trapezoidal rule. If `y` is a 1-dimensional array, + then the result is a float. If `n` is greater than 1, then the result + is an `n`-1 dimensional array. See Also -------- @@ -4865,9 +4864,9 @@ def meshgrid(*xi, copy=True, sparse=False, indexing='xy'): Returns ------- X1, X2,..., XN : ndarray - For vectors `x1`, `x2`,..., 'xn' with lengths ``Ni=len(xi)`` , - return ``(N1, N2, N3,...Nn)`` shaped arrays if indexing='ij' - or ``(N2, N1, N3,...Nn)`` shaped arrays if indexing='xy' + For vectors `x1`, `x2`,..., `xn` with lengths ``Ni=len(xi)``, + returns ``(N1, N2, N3,..., Nn)`` shaped arrays if indexing='ij' + or ``(N2, N1, N3,..., Nn)`` shaped arrays if indexing='xy' with the elements of `xi` repeated to fill the matrix along the first dimension for `x1`, the second for `x2` and so on. @@ -5016,7 +5015,7 @@ def delete(arr, obj, axis=None): >>> mask[[0,2,4]] = False >>> result = arr[mask,...] - Is equivalent to `np.delete(arr, [0,2,4], axis=0)`, but allows further + Is equivalent to ``np.delete(arr, [0,2,4], axis=0)``, but allows further use of `mask`. Examples @@ -5207,9 +5206,9 @@ def insert(arr, obj, values, axis=None): Notes ----- - Note that for higher dimensional inserts `obj=0` behaves very different - from `obj=[0]` just like `arr[:,0,:] = values` is different from - `arr[:,[0],:] = values`. + Note that for higher dimensional inserts ``obj=0`` behaves very different + from ``obj=[0]`` just like ``arr[:,0,:] = values`` is different from + ``arr[:,[0],:] = values``. Examples -------- diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 90424aab4..33b49127c 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -287,7 +287,7 @@ def load(file, mmap_mode=None, allow_pickle=False, fix_imports=True, ---------- file : file-like object, string, or pathlib.Path The file to read. File-like objects must support the - ``seek()`` and ``read()`` methods and must always + ``seek()`` and ``read()`` methods and must always be opened in binary mode. Pickled files require that the file-like object support the ``readline()`` method as well. mmap_mode : {None, 'r+', 'r', 'w+', 'c'}, optional @@ -737,9 +737,9 @@ def _ensure_ndmin_ndarray(a, *, ndmin: int): """This is a helper function of loadtxt and genfromtxt to ensure proper minimum dimension as requested - ndim: int. Supported values 1, 2, 3 - ^^ whenever this changes, keep in sync with - _ensure_ndmin_ndarray_check_param + ndim : int. Supported values 1, 2, 3 + ^^ whenever this changes, keep in sync with + _ensure_ndmin_ndarray_check_param """ # Verify that the array has at least dimensions `ndmin`. # Tweak the size and shape of the arrays - remove extraneous dimensions |
