diff options
-rw-r--r-- | numpy/core/code_generators/ufunc_docstrings.py | 32 | ||||
-rw-r--r-- | numpy/core/defchararray.py | 12 | ||||
-rw-r--r-- | numpy/core/fromnumeric.py | 2 | ||||
-rw-r--r-- | numpy/core/numeric.py | 11 | ||||
-rw-r--r-- | numpy/lib/arraypad.py | 10 | ||||
-rw-r--r-- | numpy/lib/financial.py | 2 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 16 | ||||
-rw-r--r-- | numpy/lib/polynomial.py | 4 | ||||
-rw-r--r-- | numpy/ma/core.py | 2 | ||||
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 10 |
10 files changed, 51 insertions, 50 deletions
diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py index 1abbb666b..328e43ca6 100644 --- a/numpy/core/code_generators/ufunc_docstrings.py +++ b/numpy/core/code_generators/ufunc_docstrings.py @@ -686,7 +686,7 @@ add_newdoc('numpy.core.umath', 'ceil', Returns ------- - y : {ndarray, scalar} + y : ndarray or scalar The ceiling of each element in `x`, with `float` dtype. See Also @@ -716,7 +716,7 @@ add_newdoc('numpy.core.umath', 'trunc', Returns ------- - y : {ndarray, scalar} + y : ndarray or scalar The truncated value of each element in `x`. See Also @@ -931,7 +931,7 @@ add_newdoc('numpy.core.umath', 'divide', Returns ------- - y : {ndarray, scalar} + y : ndarray or scalar The quotient ``x1/x2``, element-wise. Returns a scalar if both ``x1`` and ``x2`` are scalars. @@ -999,7 +999,7 @@ add_newdoc('numpy.core.umath', 'equal', Returns ------- - out : {ndarray, bool} + out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also @@ -1172,7 +1172,7 @@ add_newdoc('numpy.core.umath', 'fabs', Returns ------- - y : {ndarray, scalar} + y : ndarray or scalar The absolute values of `x`, the returned values are always floats. See Also @@ -1202,7 +1202,7 @@ add_newdoc('numpy.core.umath', 'floor', Returns ------- - y : {ndarray, scalar} + y : ndarray or scalar The floor of each element in `x`. See Also @@ -1632,7 +1632,7 @@ add_newdoc('numpy.core.umath', 'isnan', 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. @@ -2046,7 +2046,7 @@ add_newdoc('numpy.core.umath', 'logical_and', 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`. @@ -2112,7 +2112,7 @@ add_newdoc('numpy.core.umath', 'logical_or', 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`. @@ -2193,7 +2193,7 @@ add_newdoc('numpy.core.umath', 'maximum', 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. @@ -2251,7 +2251,7 @@ add_newdoc('numpy.core.umath', 'minimum', 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. @@ -2309,7 +2309,7 @@ add_newdoc('numpy.core.umath', 'fmax', 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. @@ -2366,7 +2366,7 @@ add_newdoc('numpy.core.umath', 'fmin', 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. @@ -2780,7 +2780,7 @@ add_newdoc('numpy.core.umath', 'rint', Returns ------- - out : {ndarray, scalar} + out : ndarray or scalar Output array is same shape and type as `x`. See Also @@ -3365,9 +3365,9 @@ add_newdoc('numpy.core.umath', 'frexp', ---------- x : array_like Array of numbers to be decomposed. - out1: ndarray, optional + out1 : ndarray, optional Output array for the mantissa. Must have the same shape as `x`. - out2: ndarray, optional + out2 : ndarray, optional Output array for the exponent. Must have the same shape as `x`. Returns diff --git a/numpy/core/defchararray.py b/numpy/core/defchararray.py index 121e32314..cc6cb5a38 100644 --- a/numpy/core/defchararray.py +++ b/numpy/core/defchararray.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index bab7cdf4b..321deb014 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -357,7 +357,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 diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 30cba28f2..1847300dd 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1150,7 +1150,8 @@ def tensordot(a, b, axes=2): ---------- a, b : array_like, len(shape) >= 1 Tensors to "dot". - axes : {integer_like, array_like} + + axes : int or (2,) array_like * integer_like If an int N, sum over the last N axes of `a` and the first N axes of `b` in order. The sizes of the corresponding axes must match. @@ -1168,11 +1169,11 @@ def tensordot(a, b, axes=2): ``axes = 0`` : tensor product $a\otimes b$ ``axes = 1`` : tensor dot product $a\cdot b$ ``axes = 2`` : (default) tensor double contraction $a:b$ - - When `axes` is integer_like, the sequence for evaluation will be: first - the -Nth axis in `a` and 0th axis in `b`, and the -1th axis in `a` and + + When `axes` is integer_like, the sequence for evaluation will be: first + the -Nth axis in `a` and 0th axis in `b`, and the -1th axis in `a` and Nth axis in `b` last. - + When there is more than one axis to sum over - and they are not the last (first) axes of `a` (`b`) - the argument `axes` should consist of two sequences of the same length, with the first axis to sum over given diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py index bbfdce794..a48199a82 100644 --- a/numpy/lib/arraypad.py +++ b/numpy/lib/arraypad.py @@ -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' @@ -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. @@ -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. @@ -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. @@ -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 diff --git a/numpy/lib/financial.py b/numpy/lib/financial.py index 5b96e5b8e..baff8b0b6 100644 --- a/numpy/lib/financial.py +++ b/numpy/lib/financial.py @@ -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 Future value (default = 0) when : {{'begin', 1}, {'end', 0}}, {string, int} When payments are due ('begin' (1) or 'end' (0)) diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 36ce94bad..135053e43 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -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 @@ -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` @@ -885,9 +885,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. @@ -901,7 +901,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 @@ -1147,7 +1147,7 @@ def interp(x, xp, fp, left=None, right=None, period=None): Returns ------- - y : {float, ndarray} + y : float or ndarray The interpolated values, same shape as `x`. Raises @@ -1250,7 +1250,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. @@ -1980,7 +1980,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 diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 2b867e244..de9376300 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -253,12 +253,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. diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 34e52d86e..9ca9136dd 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -4978,7 +4978,7 @@ class MaskedArray(ndarray): 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. diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index c03666527..3f6af86b1 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -1923,7 +1923,7 @@ cdef class RandomState: Returns ------- - samples : {ndarray, scalar} + samples : ndarray or scalar Samples from the Fisher distribution. See Also @@ -2756,7 +2756,7 @@ cdef class RandomState: Returns ------- - samples : {ndarray, scalar} + samples : ndarray or scalar The returned samples lie in [0, 1]. Raises @@ -3099,7 +3099,7 @@ cdef class RandomState: Returns ------- - samples : {ndarray, scalar} + samples : ndarray or scalar where the values are all integers in [0, n]. See Also @@ -3567,7 +3567,7 @@ cdef class RandomState: Returns ------- - samples : {ndarray, scalar} + samples : ndarray or scalar where the values are all integers in [0, n]. See Also @@ -4127,7 +4127,7 @@ cdef class RandomState: Returns ------- - samples : {ndarray, scalar} + samples : ndarray or scalar where the values are all integers in [0, n]. See Also |