neulab/docprompting-conala huggingface dataset:
numpy.amax   numpy.amax(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)[source]
 
Return the maximum of an array or maximum along an axis.  Parameters 
 
aarray_like


Input data.  
axisNone or int or tuple of ints, optional


Axis or axes along which to operate. By default, flattened input is used.  New in version 1.7.0.  If this is a tuple of ints, the maximum is selected over multiple axes, instead of a single axis or all the axes as before.  
outndarray, optional


Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output. See Output type determination for more details.  
keepdimsbool, optional


If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the amax method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.  
initialscalar, optional


The minimum value of an output element. Must be present to allow computation on empty slice. See reduce for details.  New in version 1.15.0.   
wherearray_like of bool, optional


Elements to compare for the maximum. See reduce for details.  New in version 1.17.0.     Returns 
 
amaxndarray or scalar


Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.      See also  amin

The minimum value of an array along a given axis, propagating any NaNs.  nanmax

The maximum value of an array along a given axis, ignoring any NaNs.  maximum

Element-wise maximum of two arrays, propagating any NaNs.  fmax

Element-wise maximum of two arrays, ignoring any NaNs.  argmax

Return the indices of the maximum values.  
nanmin, minimum, fmin

  Notes NaN values are propagated, that is if at least one item is NaN, the corresponding max value will be NaN as well. To ignore NaN values (MATLAB behavior), please use nanmax. Don’t use amax for element-wise comparison of 2 arrays; when a.shape[0] is 2, maximum(a[0], a[1]) is faster than amax(a, axis=0). Examples >>> a = np.arange(4).reshape((2,2))
>>> a
array([[0, 1],
       [2, 3]])
>>> np.amax(a)           # Maximum of the flattened array
3
>>> np.amax(a, axis=0)   # Maxima along the first axis
array([2, 3])
>>> np.amax(a, axis=1)   # Maxima along the second axis
array([1, 3])
>>> np.amax(a, where=[False, True], initial=-1, axis=0)
array([-1,  3])
>>> b = np.arange(5, dtype=float)
>>> b[2] = np.NaN
>>> np.amax(b)
nan
>>> np.amax(b, where=~np.isnan(b), initial=-1)
4.0
>>> np.nanmax(b)
4.0
 You can use an initial value to compute the maximum of an empty slice, or to initialize it to a different value: >>> np.amax([[-50], [10]], axis=-1, initial=0)
array([ 0, 10])
 Notice that the initial value is used as one of the elements for which the maximum is determined, unlike for the default argument Python’s max function, which is only used for empty iterables. >>> np.amax([5], initial=6)
6
>>> max([5], default=6)
5
numpy.amin   numpy.amin(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)[source]
 
Return the minimum of an array or minimum along an axis.  Parameters 
 
aarray_like


Input data.  
axisNone or int or tuple of ints, optional


Axis or axes along which to operate. By default, flattened input is used.  New in version 1.7.0.  If this is a tuple of ints, the minimum is selected over multiple axes, instead of a single axis or all the axes as before.  
outndarray, optional


Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output. See Output type determination for more details.  
keepdimsbool, optional


If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the amin method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.  
initialscalar, optional


The maximum value of an output element. Must be present to allow computation on empty slice. See reduce for details.  New in version 1.15.0.   
wherearray_like of bool, optional


Elements to compare for the minimum. See reduce for details.  New in version 1.17.0.     Returns 
 
aminndarray or scalar


Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.      See also  amax

The maximum value of an array along a given axis, propagating any NaNs.  nanmin

The minimum value of an array along a given axis, ignoring any NaNs.  minimum

Element-wise minimum of two arrays, propagating any NaNs.  fmin

Element-wise minimum of two arrays, ignoring any NaNs.  argmin

Return the indices of the minimum values.  
nanmax, maximum, fmax

  Notes NaN values are propagated, that is if at least one item is NaN, the corresponding min value will be NaN as well. To ignore NaN values (MATLAB behavior), please use nanmin. Don’t use amin for element-wise comparison of 2 arrays; when a.shape[0] is 2, minimum(a[0], a[1]) is faster than amin(a, axis=0). Examples >>> a = np.arange(4).reshape((2,2))
>>> a
array([[0, 1],
       [2, 3]])
>>> np.amin(a)           # Minimum of the flattened array
0
>>> np.amin(a, axis=0)   # Minima along the first axis
array([0, 1])
>>> np.amin(a, axis=1)   # Minima along the second axis
array([0, 2])
>>> np.amin(a, where=[False, True], initial=10, axis=0)
array([10,  1])
 >>> b = np.arange(5, dtype=float)
>>> b[2] = np.NaN
>>> np.amin(b)
nan
>>> np.amin(b, where=~np.isnan(b), initial=10)
0.0
>>> np.nanmin(b)
0.0
 >>> np.amin([[-50], [10]], axis=-1, initial=0)
array([-50,   0])
 Notice that the initial value is used as one of the elements for which the minimum is determined, unlike for the default argument Python’s max function, which is only used for empty iterables. Notice that this isn’t the same as Python’s default argument. >>> np.amin([6], initial=5)
5
>>> min([6], default=5)
6
numpy.angle   numpy.angle(z, deg=False)[source]
 
Return the angle of the complex argument.  Parameters 
 
zarray_like


A complex number or sequence of complex numbers.  
degbool, optional


Return angle in degrees if True, radians if False (default).    Returns 
 
anglendarray or scalar


The counterclockwise angle from the positive real axis on the complex plane in the range (-pi, pi], with dtype as numpy.float64.  Changed in version 1.16.0: This function works on subclasses of ndarray like ma.array.       See also  arctan2
absolute
  Notes Although the angle of the complex number 0 is undefined, numpy.angle(0) returns the value 0. Examples >>> np.angle([1.0, 1.0j, 1+1j])               # in radians
array([ 0.        ,  1.57079633,  0.78539816]) # may vary
>>> np.angle(1+1j, deg=True)                  # in degrees
45.0
numpy.any   numpy.any(a, axis=None, out=None, keepdims=<no value>, *, where=<no value>)[source]
 
Test whether any array element along a given axis evaluates to True. Returns single boolean unless axis is not None  Parameters 
 
aarray_like


Input array or object that can be converted to an array.  
axisNone or int or tuple of ints, optional


Axis or axes along which a logical OR reduction is performed. The default (axis=None) is to perform a logical OR over all the dimensions of the input array. axis may be negative, in which case it counts from the last to the first axis.  New in version 1.7.0.  If this is a tuple of ints, a reduction is performed on multiple axes, instead of a single axis or all the axes as before.  
outndarray, optional


Alternate output array in which to place the result. It must have the same shape as the expected output and its type is preserved (e.g., if it is of type float, then it will remain so, returning 1.0 for True and 0.0 for False, regardless of the type of a). See Output type determination for more details.  
keepdimsbool, optional


If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the any method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.  
wherearray_like of bool, optional


Elements to include in checking for any True values. See reduce for details.  New in version 1.20.0.     Returns 
 
anybool or ndarray


A new boolean or ndarray is returned unless out is specified, in which case a reference to out is returned.      See also  ndarray.any

equivalent method  all

Test whether all elements along a given axis evaluate to True.    Notes Not a Number (NaN), positive infinity and negative infinity evaluate to True because these are not equal to zero. Examples >>> np.any([[True, False], [True, True]])
True
 >>> np.any([[True, False], [False, False]], axis=0)
array([ True, False])
 >>> np.any([-1, 0, 5])
True
 >>> np.any(np.nan)
True
 >>> np.any([[True, False], [False, False]], where=[[False], [True]])
False
 >>> o=np.array(False)
>>> z=np.any([-1, 4, 5], out=o)
>>> z, o
(array(True), array(True))
>>> # Check now that z is a reference to o
>>> z is o
True
>>> id(z), id(o) # identity of z and o              
(191614240, 191614240)
numpy.append   numpy.append(arr, values, axis=None)[source]
 
Append values to the end of an array.  Parameters 
 
arrarray_like


Values are appended to a copy of this array.  
valuesarray_like


These values are appended to a copy of arr. It must be of the correct shape (the same shape as arr, excluding axis). If axis is not specified, values can be any shape and will be flattened before use.  
axisint, optional


The axis along which values are appended. If axis is not given, both arr and values are flattened before use.    Returns 
 
appendndarray


A copy of arr with values appended to axis. Note that append does not occur in-place: a new array is allocated and filled. If axis is None, out is a flattened array.      See also  insert

Insert elements into an array.  delete

Delete elements from an array.    Examples >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]])
array([1, 2, 3, ..., 7, 8, 9])
 When axis is specified, values must have the correct shape. >>> np.append([[1, 2, 3], [4, 5, 6]], [[7, 8, 9]], axis=0)
array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])
>>> np.append([[1, 2, 3], [4, 5, 6]], [7, 8, 9], axis=0)
Traceback (most recent call last):
    ...
ValueError: all the input arrays must have same number of dimensions, but
the array at index 0 has 2 dimension(s) and the array at index 1 has 1
dimension(s)
numpy.apply_along_axis   numpy.apply_along_axis(func1d, axis, arr, *args, **kwargs)[source]
 
Apply a function to 1-D slices along the given axis. Execute func1d(a, *args, **kwargs) where func1d operates on 1-D arrays and a is a 1-D slice of arr along axis. This is equivalent to (but faster than) the following use of ndindex and s_, which sets each of ii, jj, and kk to a tuple of indices: Ni, Nk = a.shape[:axis], a.shape[axis+1:]
for ii in ndindex(Ni):
    for kk in ndindex(Nk):
        f = func1d(arr[ii + s_[:,] + kk])
        Nj = f.shape
        for jj in ndindex(Nj):
            out[ii + jj + kk] = f[jj]
 Equivalently, eliminating the inner loop, this can be expressed as: Ni, Nk = a.shape[:axis], a.shape[axis+1:]
for ii in ndindex(Ni):
    for kk in ndindex(Nk):
        out[ii + s_[...,] + kk] = func1d(arr[ii + s_[:,] + kk])
  Parameters 
 
func1dfunction (M,) -> (Nj…)


This function should accept 1-D arrays. It is applied to 1-D slices of arr along the specified axis.  
axisinteger


Axis along which arr is sliced.  
arrndarray (Ni…, M, Nk…)


Input array.  
argsany


Additional arguments to func1d.  
kwargsany


Additional named arguments to func1d.  New in version 1.9.0.     Returns 
 
outndarray (Ni…, Nj…, Nk…)


The output array. The shape of out is identical to the shape of arr, except along the axis dimension. This axis is removed, and replaced with new dimensions equal to the shape of the return value of func1d. So if func1d returns a scalar out will have one fewer dimensions than arr.      See also  apply_over_axes

Apply a function repeatedly over multiple axes.    Examples >>> def my_func(a):
...     """Average first and last element of a 1-D array"""
...     return (a[0] + a[-1]) * 0.5
>>> b = np.array([[1,2,3], [4,5,6], [7,8,9]])
>>> np.apply_along_axis(my_func, 0, b)
array([4., 5., 6.])
>>> np.apply_along_axis(my_func, 1, b)
array([2.,  5.,  8.])
 For a function that returns a 1D array, the number of dimensions in outarr is the same as arr. >>> b = np.array([[8,1,7], [4,3,9], [5,2,6]])
>>> np.apply_along_axis(sorted, 1, b)
array([[1, 7, 8],
       [3, 4, 9],
       [2, 5, 6]])
 For a function that returns a higher dimensional array, those dimensions are inserted in place of the axis dimension. >>> b = np.array([[1,2,3], [4,5,6], [7,8,9]])
>>> np.apply_along_axis(np.diag, -1, b)
array([[[1, 0, 0],
        [0, 2, 0],
        [0, 0, 3]],
       [[4, 0, 0],
        [0, 5, 0],
        [0, 0, 6]],
       [[7, 0, 0],
        [0, 8, 0],
        [0, 0, 9]]])
numpy.apply_over_axes   numpy.apply_over_axes(func, a, axes)[source]
 
Apply a function repeatedly over multiple axes. func is called as res = func(a, axis), where axis is the first element of axes. The result res of the function call must have either the same dimensions as a or one less dimension. If res has one less dimension than a, a dimension is inserted before axis. The call to func is then repeated for each axis in axes, with res as the first argument.  Parameters 
 
funcfunction


This function must take two arguments, func(a, axis).  
aarray_like


Input array.  
axesarray_like


Axes over which func is applied; the elements must be integers.    Returns 
 
apply_over_axisndarray


The output array. The number of dimensions is the same as a, but the shape can be different. This depends on whether func changes the shape of its output with respect to its input.      See also  apply_along_axis

Apply a function to 1-D slices of an array along the given axis.    Notes This function is equivalent to tuple axis arguments to reorderable ufuncs with keepdims=True. Tuple axis arguments to ufuncs have been available since version 1.7.0. Examples >>> a = np.arange(24).reshape(2,3,4)
>>> a
array([[[ 0,  1,  2,  3],
        [ 4,  5,  6,  7],
        [ 8,  9, 10, 11]],
       [[12, 13, 14, 15],
        [16, 17, 18, 19],
        [20, 21, 22, 23]]])
 Sum over axes 0 and 2. The result has same number of dimensions as the original array: >>> np.apply_over_axes(np.sum, a, [0,2])
array([[[ 60],
        [ 92],
        [124]]])
 Tuple axis arguments to ufuncs are equivalent: >>> np.sum(a, axis=(0,2), keepdims=True)
array([[[ 60],
        [ 92],
        [124]]])
numpy.arange   numpy.arange([start, ]stop, [step, ]dtype=None, *, like=None)
 
Return evenly spaced values within a given interval. Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list. When using a non-integer step, such as 0.1, it is often better to use numpy.linspace. See the warnings section below for more information.  Parameters 
 
startinteger or real, optional


Start of interval. The interval includes this value. The default start value is 0.  
stopinteger or real


End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.  
stepinteger or real, optional


Spacing between values. For any output out, this is the distance between two adjacent values, out[i+1] - out[i]. The default step size is 1. If step is specified as a position argument, start must also be given.  
dtypedtype


The type of the output array. If dtype is not given, infer the data type from the other input arguments.  
likearray_like


Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it. In this case, it ensures the creation of an array object compatible with that passed in via this argument.  New in version 1.20.0.     Returns 
 
arangendarray


Array of evenly spaced values. For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.      Warning The length of the output might not be numerically stable. Another stability issue is due to the internal implementation of numpy.arange. The actual step value used to populate the array is dtype(start + step) - dtype(start) and not step. Precision loss can occur here, due to casting or due to using floating points when start is much larger than step. This can lead to unexpected behaviour. For example: >>> np.arange(0, 5, 0.5, dtype=int)
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
>>> np.arange(-3, 3, 0.5, dtype=int)
array([-3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8])
 In such cases, the use of numpy.linspace should be preferred.   See also  numpy.linspace

Evenly spaced numbers with careful handling of endpoints.  numpy.ogrid

Arrays of evenly spaced numbers in N-dimensions.  numpy.mgrid

Grid-shaped arrays of evenly spaced numbers in N-dimensions.    Examples >>> np.arange(3)
array([0, 1, 2])
>>> np.arange(3.0)
array([ 0.,  1.,  2.])
>>> np.arange(3,7)
array([3, 4, 5, 6])
>>> np.arange(3,7,2)
array([3, 5])
numpy.arccos   numpy.arccos(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'arccos'>
 
Trigonometric inverse cosine, element-wise. The inverse of cos so that, if y = cos(x), then x = arccos(y).  Parameters 
 
xarray_like


x-coordinate on the unit circle. For real arguments, the domain is [-1, 1].  
outndarray, None, or tuple of ndarray and None, optional


A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.  
wherearray_like, optional


This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.  **kwargs

For other keyword-only arguments, see the ufunc docs.    Returns 
 
anglendarray


The angle of the ray intersecting the unit circle at the given x-coordinate in radians [0, pi]. This is a scalar if x is a scalar.      See also  
cos, arctan, arcsin, emath.arccos

  Notes arccos is a multivalued function: for each x there are infinitely many numbers z such that cos(z) = x. The convention is to return the angle z whose real part lies in [0, pi]. For real-valued input data types, arccos always returns real output. For each value that cannot be expressed as a real number or infinity, it yields nan and sets the invalid floating point error flag. For complex-valued input, arccos is a complex analytic function that has branch cuts [-inf, -1] and [1, inf] and is continuous from above on the former and from below on the latter. The inverse cos is also known as acos or cos^-1. References M. Abramowitz and I.A. Stegun, “Handbook of Mathematical Functions”, 10th printing, 1964, pp. 79. https://personal.math.ubc.ca/~cbm/aands/page_79.htm Examples We expect the arccos of 1 to be 0, and of -1 to be pi: >>> np.arccos([1, -1])
array([ 0.        ,  3.14159265])
 Plot arccos: >>> import matplotlib.pyplot as plt
>>> x = np.linspace(-1, 1, num=100)
>>> plt.plot(x, np.arccos(x))
>>> plt.axis('tight')
>>> plt.show()
numpy.arccosh   numpy.arccosh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'arccosh'>
 
Inverse hyperbolic cosine, element-wise.  Parameters 
 
xarray_like


Input array.  
outndarray, None, or tuple of ndarray and None, optional


A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.  
wherearray_like, optional


This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.  **kwargs

For other keyword-only arguments, see the ufunc docs.    Returns 
 
arccoshndarray


Array of the same shape as x. This is a scalar if x is a scalar.      See also  
cosh, arcsinh, sinh, arctanh, tanh

  Notes arccosh is a multivalued function: for each x there are infinitely many numbers z such that cosh(z) = x. The convention is to return the z whose imaginary part lies in [-pi, pi] and the real part in [0, inf]. For real-valued input data types, arccosh always returns real output. For each value that cannot be expressed as a real number or infinity, it yields nan and sets the invalid floating point error flag. For complex-valued input, arccosh is a complex analytical function that has a branch cut [-inf, 1] and is continuous from above on it. References  1 
M. Abramowitz and I.A. Stegun, “Handbook of Mathematical Functions”, 10th printing, 1964, pp. 86. https://personal.math.ubc.ca/~cbm/aands/page_86.htm  2 
Wikipedia, “Inverse hyperbolic function”, https://en.wikipedia.org/wiki/Arccosh   Examples >>> np.arccosh([np.e, 10.0])
array([ 1.65745445,  2.99322285])
>>> np.arccosh(1)
0.0