8000 Sundy doc changes by tacaswell · Pull Request #5360 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Sundy doc changes #5360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions numpy/core/code_generators/ufunc_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The ceiling of each element in `x`, with `float` dtype.

See Also
Expand Down Expand Up @@ -716,7 +716,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The truncated value of each element in `x`.

See Also
Expand Down Expand Up @@ -931,7 +931,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The quotient `x1/x2`, element-wise. Returns a scalar if
both `x1` and `x2` are scalars.

Expand Down Expand Up @@ -999,7 +999,7 @@ def add_newdoc(place, name, doc):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand Down Expand Up @@ -1172,7 +1172,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The absolute values of `x`, the returned values are always floats.

See Also
Expand Down Expand Up @@ -1202,7 +1202,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The floor of each element in `x`.

See Also
Expand Down Expand Up @@ -1632,7 +1632,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, bool}
y : ndarray or bool
For scalar input, the result is a new boolean with value True if
the input is NaN; otherwise the value is False.

Expand Down Expand Up @@ -2046,7 +2046,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, bool}
y : ndarray or bool
Boolean result with the same shape as `x1` and `x2` of the logical
AND operation on corresponding elements of `x1` and `x2`.

Expand Down Expand Up @@ -2112,7 +2112,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, bool}
y : ndarray or bool
Boolean result with the same shape as `x1` and `x2` of the logical
OR operation on elements of `x1` and `x2`.

Expand Down Expand Up @@ -2193,7 +2193,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The maximum of `x1` and `x2`, element-wise. Returns scalar if
both `x1` and `x2` are scalars.

Expand Down Expand Up @@ -2251,7 +2251,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The minimum of `x1` and `x2`, element-wise. Returns scalar if
both `x1` and `x2` are scalars.

Expand Down Expand Up @@ -2309,7 +2309,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The minimum of `x1` and `x2`, element-wise. Returns scalar if
both `x1` and `x2` are scalars.

Expand Down Expand Up @@ -2366,7 +2366,7 @@ def add_newdoc(place, name, doc):

Returns
-------
y : {ndarray, scalar}
y : ndarray or scalar
The minimum of `x1` and `x2`, element-wise. Returns scalar if
both `x1` and `x2` are scalars.

Expand Down Expand Up @@ -2780,7 +2780,7 @@ def add_newdoc(place, name, doc):

Returns
-------
out : {ndarray, scalar}
out : ndarray or scalar
Output array is same shape and type as `x`.

See Also
Expand Down
12 changes: 6 additions & 6 deletions numpy/core/defchararray.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def equal(x1, x2):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand All @@ -133,7 +133,7 @@ def not_equal(x1, x2):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand All @@ -158,7 +158,7 @@ def greater_equal(x1, x2):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand All @@ -182,7 +182,7 @@ def less_equal(x1, x2):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand All @@ -206,7 +206,7 @@ def greater(x1, x2):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand All @@ -230,7 +230,7 @@ def less(x1, x2):

Returns
-------
out : {ndarray, bool}
out : ndarray or bool
Output array of bools, or a single bool if x1 and x2 are scalars.

See Also
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def repeat(a, repeats, axis=None):
----------
a : array_like
Input array.
repeats : {int, array of ints}
repeats : int or array of ints
The number of repetitions for each element. `repeats` is broadcasted
to fit the shape of the given axis.
axis : int, optional
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ def tensordot(a, b, axes=2):
----------
a, b : array_like, len(shape) >= 1
Tensors to "dot".
axes : variable type
axes : int or (2,) array_like
* integer_like scalar
Number of axes to sum over (applies to both arrays); or
* (2,) array_like, both elements array_like of the same length
Expand Down
4 changes: 2 additions & 2 deletions numpy/core/src/umath/umathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ static const char frdoc[] =
" ----------\n"
" x : array_like\n"
" Array of numbers to be decomposed.\n"
" out1: ndarray, optional\n"
" out1 : ndarray, optional\n"
" Output array for the mantissa. Must have the same shape as `x`.\n"
" out2: ndarray, optional\n"
" out2 : ndarray, optional\n"
" Output array for the exponent. Must have the same shape as `x`.\n"
"\n"
" Returns\n"
Expand Down
10 changes: 5 additions & 5 deletions numpy/lib/arraypad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ def pad(array, pad_width, mode=None, **kwargs):
((before, after),) yields same before and after pad for each axis.
(pad,) or int is a shortcut for before = after = pad width for all
axes.
mode : {str, function}
mode : str or function
One of the following string values or a user supplied function.

'constant'
Expand Down Expand Up @@ -1140,7 +1140,7 @@ def pad(array, pad_width, mode=None, **kwargs):
end values are used to pad the beginning.
<function>
Padding function, see Notes.
stat_length : {sequence, int}, optional
stat_length : sequence or int, optional
Used in 'maximum', 'mean', 'median', and 'minimum'. Number of
values at edge of each axis used to calculate the statistic value.

Expand All @@ -1154,7 +1154,7 @@ def pad(array, pad_width, mode=None, **kwargs):
length for all axes.

Default is ``None``, to use the entire axis.
constant_values : {sequence, int}, optional
constant_values : sequence or int, optional
Used in 'constant'. The values to set the padded values for each
axis.

Expand All @@ -1168,7 +1168,7 @@ def pad(array, pad_width, mode=None, **kwargs):
all axes.

Default is 0.
end_values : {sequence, int}, optional
end_values : sequence or int, optional
Used in 'linear_ramp'. The values used for the ending value of the
linear_ramp and that will form the edge of the padded array.

Expand All @@ -1182,7 +1182,7 @@ def pad(array, pad_width, mode=None, **kwargs):
all axes.

Default is 0.
reflect_type : str {'even', 'odd'}, optional
reflect_type : {'even', 'odd'}, optional
Used in 'reflect', and 'symmetric'. The 'even' style is the
default with an unaltered reflection around the edge value. For
the 'odd' style, the extented part of the array is created by
Expand Down
2 changes: 1 addition & 1 deletion numpy/lib/financial.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def pmt(rate, nper, pv, fv=0, when='end'):
Number of compounding periods
pv : array_like
Present value
fv : array_like (optional)
fv : array_like, (optional)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parenthesis should be removed for optional to match the other docstrings

Future value (default = 0)
when : {{'begin', 1}, {'end', 0}}, {string, int}
When payments are due ('begin' (1) or 'end' (0))
Expand Down
16 changes: 8 additions & 8 deletions numpy/lib/function_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
normed : bool, optional
If False, returns the number of samples in each bin. If True,
returns the bin density ``bin_count / sample_count / bin_volume``.
weights : array_like (N,), optional
weights : (N,) array_like, optional
An array of values `w_i` weighing each sample `(x_i, y_i, z_i, ...)`.
Weights are normalized to 1 if normed is True. If normed is False,
the values of the returned histogram are equal to the sum of the
Expand Down Expand Up @@ -461,7 +461,7 @@ def average(a, axis=None, weights=None, returned=False):

Returns
-------
average, [sum_of_weights] : {array_type, double}
average, [sum_of_weights] : array_type or double
Return the average along the specified axis. When returned is `True`,
return a tuple with the average as the first element and the sum
of the weights as the second element. The return type is `Float`
Expand Down Expand Up @@ -886,9 +886,9 @@ def copy(a, order='K'):
def gradient(f, *varargs, **kwargs):
"""
Return the gradient of an N-dimensional array.

The gradient is computed using second order accurate central differences
in the interior and either first differences or second order accurate
in the interior and either first differences or second order accurate
one-sides (forward or backwards) differences at the boundaries. The
returned gradient hence has the same shape as the input array.

Expand All @@ -902,7 +902,7 @@ def gradient(f, *varargs, **kwargs):
edge_order : {1, 2}, optional
Gradient is calculated using N\ :sup:`th` order accurate differences
at the boundaries. Default: 1.

.. versionadded:: 1.9.1

Returns
Expand Down Expand Up @@ -1140,7 +1140,7 @@ def interp(x, xp, fp, left=None, right=None):

Returns
-------
y : {float, ndarray}
y : float or ndarray
The interpolated values, same shape as `x`.

Raises
Expand Down Expand Up @@ -1204,7 +1204,7 @@ def angle(z, deg=0):

Returns
-------
angle : {ndarray, scalar}
angle : ndarray or scalar
The counterclockwise angle from the positive real axis on
the complex plane, with dtype as numpy.float64.

Expand Down Expand Up @@ -1932,7 +1932,7 @@ def corrcoef(x, y=None, rowvar=1, bias=0, ddof=None):
observations (unbiased estimate). If `bias` is 1, then
normalization is by ``N``. These values can be overridden by using
the keyword ``ddof`` in numpy versions >= 1.5.
ddof : {None, int}, optional
ddof : int, optional
.. versionadded:: 1.5
If not ``None`` normalization is by ``(N - ddof)``, where ``N`` is
the number of observations; this overrides the value implied by
Expand Down
4 changes: 2 additions & 2 deletions numpy/lib/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ def polyint(p, m=1, k=None):

Parameters
----------
p : {array_like, poly1d}
p : array_like or poly1d
Polynomial to differentiate.
A sequence is interpreted as polynomial coefficients, see `poly1d`.
m : int, optional
Order of the antiderivative. (Default: 1)
k : {None, list of `m` scalars, scalar}, optional
k : list of `m` scalars or scalar, optional
Integration constants. They are given in the order of integration:
those corresponding to highest-order terms come first.

Expand Down
2 changes: 1 addition & 1 deletion numpy/ma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4978,7 +4978,7 @@ def argmin(self, axis=None, fill_value=None, out=None):

Returns
-------
{ndarray, scalar}
ndarray or scalar
If multi-dimension input, returns a new ndarray of indices to the
minimum values along the given axis. Otherwise, returns a scalar
of index to the minimum values along the given axis.
Expand Down
10 changes: 5 additions & 5 deletions numpy/random/mtrand/mtrand.pyx
E8D3
Original file line numberDiff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ cdef class RandomState:

Returns
-------
samples : {ndarray, scalar}
samples : ndarray or scalar
Samples from the Fisher distribution.

See Also
Expand Down Expand Up @@ -2748,7 +2748,7 @@ cdef class RandomState:

Returns
-------
samples : {ndarray, scalar}
samples : ndarray or scalar
The returned samples lie in [0, 1].

Raises
Expand Down Expand Up @@ -3091,7 +3091,7 @@ cdef class RandomState:

Returns
-------
samples : {ndarray, scalar}
samples : ndarray or scalar
where the values are all integers in [0, n].

See Also
Expand Down Expand Up @@ -3559,7 +3559,7 @@ cdef class RandomState:

Returns
-------
samples : {ndarray, scalar}
samples : ndarray or scalar
where the values are all integers in [0, n].

See Also
Expand Down Expand Up @@ -4119,7 +4119,7 @@ cdef class RandomState:

Returns
-------
samples : {ndarray, scalar}
samples : ndarray or scalar
where the values are all integers in [0, n].

See Also
Expand Down
0