neulab/docprompting-conala huggingface dataset:
numpy.may_share_memory   numpy.may_share_memory(a, b, /, max_work=None)
 
Determine if two arrays might share memory A return of True does not necessarily mean that the two arrays share any element. It just means that they might. Only the memory bounds of a and b are checked by default.  Parameters 
 
a, bndarray


Input arrays  
max_workint, optional


Effort to spend on solving the overlap problem. See shares_memory for details. Default for may_share_memory is to do a bounds check.    Returns 
 
outbool

    See also  shares_memory
  Examples >>> np.may_share_memory(np.array([1,2]), np.array([5,8,9]))
False
>>> x = np.zeros([3, 4])
>>> np.may_share_memory(x[:,0], x[:,1])
True
numpy.mean   numpy.mean(a, axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]
 
Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.  Parameters 
 
aarray_like


Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.  
axisNone or int or tuple of ints, optional


Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.  New in version 1.7.0.  If this is a tuple of ints, a mean is performed over multiple axes, instead of a single axis or all the axes as before.  
dtypedata-type, optional


Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.  
outndarray, optional


Alternate output array in which to place the result. The default is None; if provided, it must have the same shape as the expected output, but the type will be cast if necessary. 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 mean 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 the mean. See reduce for details.  New in version 1.20.0.     Returns 
 
mndarray, see dtype parameter above


If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.      See also  average

Weighted average  
std, var, nanmean, nanstd, nanvar

  Notes The arithmetic mean is the sum of the elements along the axis divided by the number of elements. Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue. By default, float16 results are computed using float32 intermediates for extra precision. Examples >>> a = np.array([[1, 2], [3, 4]])
>>> np.mean(a)
2.5
>>> np.mean(a, axis=0)
array([2., 3.])
>>> np.mean(a, axis=1)
array([1.5, 3.5])
 In single precision, mean can be inaccurate: >>> a = np.zeros((2, 512*512), dtype=np.float32)
>>> a[0, :] = 1.0
>>> a[1, :] = 0.1
>>> np.mean(a)
0.54999924
 Computing the mean in float64 is more accurate: >>> np.mean(a, dtype=np.float64)
0.55000000074505806 # may vary
 Specifying a where argument: >>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]]) >>> np.mean(a) 12.0 >>> np.mean(a, where=[[True], [False], [False]]) 9.0
numpy.median   numpy.median(a, axis=None, out=None, overwrite_input=False, keepdims=False)[source]
 
Compute the median along the specified axis. Returns the median of the array elements.  Parameters 
 
aarray_like


Input array or object that can be converted to an array.  
axis{int, sequence of int, None}, optional


Axis or axes along which the medians are computed. The default is to compute the median along a flattened version of the array. A sequence of axes is supported since version 1.9.0.  
outndarray, optional


Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output, but the type (of the output) will be cast if necessary.  
overwrite_inputbool, optional


If True, then allow use of memory of input array a for calculations. The input array will be modified by the call to median. This will save memory when you do not need to preserve the contents of the input array. Treat the input as undefined, but it will probably be fully or partially sorted. Default is False. If overwrite_input is True and a is not already an ndarray, an error will be raised.  
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 original arr.  New in version 1.9.0.     Returns 
 
medianndarray


A new array holding the result. If the input contains integers or floats smaller than float64, then the output data-type is np.float64. Otherwise, the data-type of the output is the same as that of the input. If out is specified, that array is returned instead.      See also  
mean, percentile

  Notes Given a vector V of length N, the median of V is the middle value of a sorted copy of V, V_sorted - i e., V_sorted[(N-1)/2], when N is odd, and the average of the two middle values of V_sorted when N is even. Examples >>> a = np.array([[10, 7, 4], [3, 2, 1]])
>>> a
array([[10,  7,  4],
       [ 3,  2,  1]])
>>> np.median(a)
3.5
>>> np.median(a, axis=0)
array([6.5, 4.5, 2.5])
>>> np.median(a, axis=1)
array([7.,  2.])
>>> m = np.median(a, axis=0)
>>> out = np.zeros_like(m)
>>> np.median(a, axis=0, out=m)
array([6.5,  4.5,  2.5])
>>> m
array([6.5,  4.5,  2.5])
>>> b = a.copy()
>>> np.median(b, axis=1, overwrite_input=True)
array([7.,  2.])
>>> assert not np.all(a==b)
>>> b = a.copy()
>>> np.median(b, axis=None, overwrite_input=True)
3.5
>>> assert not np.all(a==b)
numpy.mgrid   numpy.mgrid = <numpy.lib.index_tricks.MGridClass object>
 
nd_grid instance which returns a dense multi-dimensional “meshgrid”. An instance of numpy.lib.index_tricks.nd_grid which returns an dense (or fleshed out) mesh-grid when indexed, so that each returned argument has the same shape. The dimensions and number of the output arrays are equal to the number of indexing dimensions. If the step length is not a complex number, then the stop is not inclusive. However, if the step length is a complex number (e.g. 5j), then the integer part of its magnitude is interpreted as specifying the number of points to create between the start and stop values, where the stop value is inclusive.  Returns 
 mesh-grid ndarrays all of the same dimensions
    See also  numpy.lib.index_tricks.nd_grid

class of ogrid and mgrid objects  ogrid

like mgrid but returns open (not fleshed out) mesh grids  r_

array concatenator    Examples >>> np.mgrid[0:5,0:5]
array([[[0, 0, 0, 0, 0],
        [1, 1, 1, 1, 1],
        [2, 2, 2, 2, 2],
        [3, 3, 3, 3, 3],
        [4, 4, 4, 4, 4]],
       [[0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4]]])
>>> np.mgrid[-1:1:5j]
array([-1. , -0.5,  0. ,  0.5,  1. ])
numpy.min_scalar_type   numpy.min_scalar_type(a, /)
 
For scalar a, returns the data type with the smallest size and smallest scalar kind which can hold its value. For non-scalar array a, returns the vector’s dtype unmodified. Floating point values are not demoted to integers, and complex values are not demoted to floats.  Parameters 
 
ascalar or array_like


The value whose minimal data type is to be found.    Returns 
 
outdtype


The minimal data type.      See also  
result_type, promote_types, dtype, can_cast

  Notes  New in version 1.6.0.  Examples >>> np.min_scalar_type(10)
dtype('uint8')
 >>> np.min_scalar_type(-260)
dtype('int16')
 >>> np.min_scalar_type(3.1)
dtype('float16')
 >>> np.min_scalar_type(1e50)
dtype('float64')
 >>> np.min_scalar_type(np.arange(4,dtype='f8'))
dtype('float64')
numpy.minimum   numpy.minimum(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'minimum'>
 
Element-wise minimum of array elements. Compare two arrays and returns a new array containing the element-wise minima. If one of the elements being compared is a NaN, then that element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.  Parameters 
 
x1, x2array_like


The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).  
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 
 
yndarray or scalar


The minimum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.      See also  maximum

Element-wise maximum of two arrays, propagates NaNs.  fmin

Element-wise minimum of two arrays, ignores NaNs.  amin

The minimum value of an array along a given axis, propagates NaNs.  nanmin

The minimum value of an array along a given axis, ignores NaNs.  
fmax, amax, nanmax

  Notes The minimum is equivalent to np.where(x1 <= x2, x1, x2) when neither x1 nor x2 are NaNs, but it is faster and does proper broadcasting. Examples >>> np.minimum([2, 3, 4], [1, 5, 2])
array([1, 3, 2])
 >>> np.minimum(np.eye(2), [0.5, 2]) # broadcasting
array([[ 0.5,  0. ],
       [ 0. ,  1. ]])
 >>> np.minimum([np.nan, 0, np.nan],[0, np.nan, np.nan])
array([nan, nan, nan])
>>> np.minimum(-np.Inf, 1)
-inf
numpy.mintypecode   numpy.mintypecode(typechars, typeset='GDFgdf', default='d')[source]
 
Return the character for the minimum-size type to which given types can be safely cast. The returned type character must represent the smallest size dtype such that an array of the returned type can handle the data from an array of all types in typechars (or if typechars is an array, then its dtype.char).  Parameters 
 
typecharslist of str or array_like


If a list of strings, each string should represent a dtype. If array_like, the character representation of the array dtype is used.  
typesetstr or list of str, optional


The set of characters that the returned character is chosen from. The default set is ‘GDFgdf’.  
defaultstr, optional


The default character, this is returned if none of the characters in typechars matches a character in typeset.    Returns 
 
typecharstr


The character representing the minimum-size type that was found.      See also  
dtype, sctype2char, maximum_sctype

  Examples >>> np.mintypecode(['d', 'f', 'S'])
'd'
>>> x = np.array([1.1, 2-3.j])
>>> np.mintypecode(x)
'D'
 >>> np.mintypecode('abceh', default='G')
'G'
numpy.mod   numpy.mod(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'remainder'>
 
Returns the element-wise remainder of division. Computes the remainder complementary to the floor_divide function. It is equivalent to the Python modulus operator``x1 % x2`` and has the same sign as the divisor x2. The MATLAB function equivalent to np.remainder is mod.  Warning This should not be confused with:  Python 3.7’s math.remainder and C’s remainder, which computes the IEEE remainder, which are the complement to round(x1 / x2). The MATLAB rem function and or the C % operator which is the complement to int(x1 / x2).    Parameters 
 
x1array_like


Dividend array.  
x2array_like


Divisor array. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).  
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 
 
yndarray


The element-wise remainder of the quotient floor_divide(x1, x2). This is a scalar if both x1 and x2 are scalars.      See also  floor_divide

Equivalent of Python // operator.  divmod

Simultaneous floor division and remainder.  fmod

Equivalent of the MATLAB rem function.  
divide, floor

  Notes Returns 0 when x2 is 0 and both x1 and x2 are (arrays of) integers. mod is an alias of remainder. Examples >>> np.remainder([4, 7], [2, 3])
array([0, 1])
>>> np.remainder(np.arange(7), 5)
array([0, 1, 2, 3, 4, 0, 1])
 The % operator can be used as a shorthand for np.remainder on ndarrays. >>> x1 = np.arange(7)
>>> x1 % 5
array([0, 1, 2, 3, 4, 0, 1])
numpy.modf   numpy.modf(x, [out1, out2, ]/, [out=(None, None), ]*, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'modf'>
 
Return the fractional and integral parts of an array, element-wise. The fractional and integral parts are negative if the given number is negative.  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 
 
y1ndarray


Fractional part of x. This is a scalar if x is a scalar.  
y2ndarray


Integral part of x. This is a scalar if x is a scalar.      See also  divmod

divmod(x, 1) is equivalent to modf with the return values switched, except it always has a positive remainder.    Notes For integer input the return values are floats. Examples >>> np.modf([0, 3.5])
(array([ 0. ,  0.5]), array([ 0.,  3.]))
>>> np.modf(-0.5)
(-0.5, -0)
numpy.moveaxis   numpy.moveaxis(a, source, destination)[source]
 
Move axes of an array to new positions. Other axes remain in their original order.  New in version 1.11.0.   Parameters 
 
anp.ndarray


The array whose axes should be reordered.  
sourceint or sequence of int


Original positions of the axes to move. These must be unique.  
destinationint or sequence of int


Destination positions for each of the original axes. These must also be unique.    Returns 
 
resultnp.ndarray


Array with moved axes. This array is a view of the input array.      See also  transpose

Permute the dimensions of an array.  swapaxes

Interchange two axes of an array.    Examples >>> x = np.zeros((3, 4, 5))
>>> np.moveaxis(x, 0, -1).shape
(4, 5, 3)
>>> np.moveaxis(x, -1, 0).shape
(5, 3, 4)
 These all achieve the same result: >>> np.transpose(x).shape
(5, 4, 3)
>>> np.swapaxes(x, 0, -1).shape
(5, 4, 3)
>>> np.moveaxis(x, [0, 1], [-1, -2]).shape
(5, 4, 3)
>>> np.moveaxis(x, [0, 1, 2], [-1, -2, -3]).shape
(5, 4, 3)
numpy.msort   numpy.msort(a)[source]
 
Return a copy of an array sorted along the first axis.  Parameters 
 
aarray_like


Array to be sorted.    Returns 
 
sorted_arrayndarray


Array of the same type and shape as a.      See also  sort
  Notes np.msort(a) is equivalent to np.sort(a, axis=0).
numpy.multiply   numpy.multiply(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'multiply'>
 
Multiply arguments element-wise.  Parameters 
 
x1, x2array_like


Input arrays to be multiplied. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).  
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 
 
yndarray


The product of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.     Notes Equivalent to x1 * x2 in terms of array broadcasting. Examples >>> np.multiply(2.0, 4.0)
8.0
 >>> x1 = np.arange(9.0).reshape((3, 3))
>>> x2 = np.arange(3.0)
>>> np.multiply(x1, x2)
array([[  0.,   1.,   4.],
       [  0.,   4.,  10.],
       [  0.,   7.,  16.]])
 The * operator can be used as a shorthand for np.multiply on ndarrays. >>> x1 = np.arange(9.0).reshape((3, 3))
>>> x2 = np.arange(3.0)
>>> x1 * x2
array([[  0.,   1.,   4.],
       [  0.,   4.,  10.],
       [  0.,   7.,  16.]])
numpy.NAN
 
IEEE 754 floating point representation of Not a Number (NaN). NaN and NAN are equivalent definitions of nan. Please use nan instead of NAN. See Also nan
numpy.NaN
 
IEEE 754 floating point representation of Not a Number (NaN). NaN and NAN are equivalent definitions of nan. Please use nan instead of NaN. See Also nan
numpy.nan
 
IEEE 754 floating point representation of Not a Number (NaN). Returns y : A floating point representation of Not a Number. See Also isnan : Shows which elements are Not a Number. isfinite : Shows which elements are finite (not one of Not a Number, positive infinity and negative infinity) Notes NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). This means that Not a Number is not equivalent to infinity. NaN and NAN are aliases of nan. Examples >>> np.nan
nan
>>> np.log(-1)
nan
>>> np.log([-1, 1, 2])
array([        NaN,  0.        ,  0.69314718])
numpy.nan_to_num   numpy.nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None)[source]
 
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan, posinf and/or neginf keywords. If x is inexact, NaN is replaced by zero or by the user defined value in nan keyword, infinity is replaced by the largest finite floating point values representable by x.dtype or by the user defined value in posinf keyword and -infinity is replaced by the most negative finite floating point values representable by x.dtype or by the user defined value in neginf keyword. For complex dtypes, the above is applied to each of the real and imaginary components of x separately. If x is not inexact, then no replacements are made.  Parameters 
 
xscalar or array_like


Input data.  
copybool, optional


Whether to create a copy of x (True) or to replace values in-place (False). The in-place operation only occurs if casting to an array does not require a copy. Default is True.  New in version 1.13.   
nanint, float, optional


Value to be used to fill NaN values. If no value is passed then NaN values will be replaced with 0.0.  New in version 1.17.   
posinfint, float, optional


Value to be used to fill positive infinity values. If no value is passed then positive infinity values will be replaced with a very large number.  New in version 1.17.   
neginfint, float, optional


Value to be used to fill negative infinity values. If no value is passed then negative infinity values will be replaced with a very small (or negative) number.  New in version 1.17.     Returns 
 
outndarray


x, with the non-finite values replaced. If copy is False, this may be x itself.      See also  isinf

Shows which elements are positive or negative infinity.  isneginf

Shows which elements are negative infinity.  isposinf

Shows which elements are positive infinity.  isnan

Shows which elements are Not a Number (NaN).  isfinite

Shows which elements are finite (not NaN, not infinity)    Notes NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). This means that Not a Number is not equivalent to infinity. Examples >>> np.nan_to_num(np.inf)
1.7976931348623157e+308
>>> np.nan_to_num(-np.inf)
-1.7976931348623157e+308
>>> np.nan_to_num(np.nan)
0.0
>>> x = np.array([np.inf, -np.inf, np.nan, -128, 128])
>>> np.nan_to_num(x)
array([ 1.79769313e+308, -1.79769313e+308,  0.00000000e+000, # may vary
       -1.28000000e+002,  1.28000000e+002])
>>> np.nan_to_num(x, nan=-9999, posinf=33333333, neginf=33333333)
array([ 3.3333333e+07,  3.3333333e+07, -9.9990000e+03, 
       -1.2800000e+02,  1.2800000e+02])
>>> y = np.array([complex(np.inf, np.nan), np.nan, complex(np.nan, np.inf)])
array([  1.79769313e+308,  -1.79769313e+308,   0.00000000e+000, # may vary
     -1.28000000e+002,   1.28000000e+002])
>>> np.nan_to_num(y)
array([  1.79769313e+308 +0.00000000e+000j, # may vary
         0.00000000e+000 +0.00000000e+000j,
         0.00000000e+000 +1.79769313e+308j])
>>> np.nan_to_num(y, nan=111111, posinf=222222)
array([222222.+111111.j, 111111.     +0.j, 111111.+222222.j])
numpy.nanargmax   numpy.nanargmax(a, axis=None, out=None, *, keepdims=<no value>)[source]
 
Return the indices of the maximum values in the specified axis ignoring NaNs. For all-NaN slices ValueError is raised. Warning: the results cannot be trusted if a slice contains only NaNs and -Infs.  Parameters 
 
aarray_like


Input data.  
axisint, optional


Axis along which to operate. By default flattened input is used.  
outarray, optional


If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype.  New in version 1.22.0.   
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 array.  New in version 1.22.0.     Returns 
 
index_arrayndarray


An array of indices or a single index value.      See also  
argmax, nanargmin

  Examples >>> a = np.array([[np.nan, 4], [2, 3]])
>>> np.argmax(a)
0
>>> np.nanargmax(a)
1
>>> np.nanargmax(a, axis=0)
array([1, 0])
>>> np.nanargmax(a, axis=1)
array([1, 1])