neulab/docprompting-conala huggingface dataset:
numpy.nanargmin   numpy.nanargmin(a, axis=None, out=None, *, keepdims=<no value>)[source]
 
Return the indices of the minimum 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  
argmin, nanargmax

  Examples >>> a = np.array([[np.nan, 4], [2, 3]])
>>> np.argmin(a)
0
>>> np.nanargmin(a)
2
>>> np.nanargmin(a, axis=0)
array([1, 1])
>>> np.nanargmin(a, axis=1)
array([1, 0])
numpy.nancumprod   numpy.nancumprod(a, axis=None, dtype=None, out=None)[source]
 
Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one. The cumulative product does not change when NaNs are encountered and leading NaNs are replaced by ones. Ones are returned for slices that are all-NaN or empty.  New in version 1.12.0.   Parameters 
 
aarray_like


Input array.  
axisint, optional


Axis along which the cumulative product is computed. By default the input is flattened.  
dtypedtype, optional


Type of the returned array, as well as of the accumulator in which the elements are multiplied. If dtype is not specified, it defaults to the dtype of a, unless a has an integer dtype with a precision less than that of the default platform integer. In that case, the default platform integer is used instead.  
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 resulting values will be cast if necessary.    Returns 
 
nancumprodndarray


A new array holding the result is returned unless out is specified, in which case it is returned.      See also  numpy.cumprod

Cumulative product across array propagating NaNs.  isnan

Show which elements are NaN.    Examples >>> np.nancumprod(1)
array([1])
>>> np.nancumprod([1])
array([1])
>>> np.nancumprod([1, np.nan])
array([1.,  1.])
>>> a = np.array([[1, 2], [3, np.nan]])
>>> np.nancumprod(a)
array([1.,  2.,  6.,  6.])
>>> np.nancumprod(a, axis=0)
array([[1.,  2.],
       [3.,  2.]])
>>> np.nancumprod(a, axis=1)
array([[1.,  2.],
       [3.,  3.]])
numpy.nancumsum   numpy.nancumsum(a, axis=None, dtype=None, out=None)[source]
 
Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. The cumulative sum does not change when NaNs are encountered and leading NaNs are replaced by zeros. Zeros are returned for slices that are all-NaN or empty.  New in version 1.12.0.   Parameters 
 
aarray_like


Input array.  
axisint, optional


Axis along which the cumulative sum is computed. The default (None) is to compute the cumsum over the flattened array.  
dtypedtype, optional


Type of the returned array and of the accumulator in which the elements are summed. If dtype is not specified, it defaults to the dtype of a, unless a has an integer dtype with a precision less than that of the default platform integer. In that case, the default platform integer is used.  
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 will be cast if necessary. See Output type determination for more details.    Returns 
 
nancumsumndarray.


A new array holding the result is returned unless out is specified, in which it is returned. The result has the same size as a, and the same shape as a if axis is not None or a is a 1-d array.      See also  numpy.cumsum

Cumulative sum across array propagating NaNs.  isnan

Show which elements are NaN.    Examples >>> np.nancumsum(1)
array([1])
>>> np.nancumsum([1])
array([1])
>>> np.nancumsum([1, np.nan])
array([1.,  1.])
>>> a = np.array([[1, 2], [3, np.nan]])
>>> np.nancumsum(a)
array([1.,  3.,  6.,  6.])
>>> np.nancumsum(a, axis=0)
array([[1.,  2.],
       [4.,  2.]])
>>> np.nancumsum(a, axis=1)
array([[1.,  3.],
       [3.,  3.]])
numpy.nanmax   numpy.nanmax(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, ignoring any NaNs. When all-NaN slices are encountered a RuntimeWarning is raised and NaN is returned for that slice.  Parameters 
 
aarray_like


Array containing numbers whose maximum is desired. If a is not an array, a conversion is attempted.  
axis{int, tuple of int, None}, optional


Axis or axes along which the maximum is computed. The default is to compute the maximum of the flattened array.  
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.  New in version 1.8.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 original a. If the value is anything but the default, then keepdims will be passed through to the max method of sub-classes of ndarray. If the sub-classes methods does not implement keepdims any exceptions will be raised.  New in version 1.8.0.   
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.22.0.   
wherearray_like of bool, optional


Elements to compare for the maximum. See reduce for details.  New in version 1.22.0.     Returns 
 
nanmaxndarray


An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, an ndarray scalar is returned. The same dtype as a is returned.      See also  nanmin

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

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

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

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

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

Shows which elements are neither NaN nor infinity.  
amin, fmin, minimum

  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. Positive infinity is treated as a very large number and negative infinity is treated as a very small (i.e. negative) number. If the input has a integer type the function is equivalent to np.max. Examples >>> a = np.array([[1, 2], [3, np.nan]])
>>> np.nanmax(a)
3.0
>>> np.nanmax(a, axis=0)
array([3.,  2.])
>>> np.nanmax(a, axis=1)
array([2.,  3.])
 When positive infinity and negative infinity are present: >>> np.nanmax([1, 2, np.nan, np.NINF])
2.0
>>> np.nanmax([1, 2, np.nan, np.inf])
inf
numpy.nanmean   numpy.nanmean(a, axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]
 
Compute the arithmetic mean along the specified axis, ignoring NaNs. 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. For all-NaN slices, NaN is returned and a RuntimeWarning is raised.  New in version 1.8.0.   Parameters 
 
aarray_like


Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.  
axis{int, tuple of int, None}, optional


Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.  
dtypedata-type, optional


Type to use in computing the mean. For integer inputs, the default is float64; for inexact 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 original a. If the value is anything but the default, then keepdims will be passed through to the mean or sum methods of sub-classes of ndarray. If the sub-classes methods 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.22.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. Nan is returned for slices that contain only NaNs.      See also  average

Weighted average  mean

Arithmetic mean taken while not ignoring NaNs  
var, nanvar

  Notes The arithmetic mean is the sum of the non-NaN elements along the axis divided by the number of non-NaN 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. Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue. Examples >>> a = np.array([[1, np.nan], [3, 4]])
>>> np.nanmean(a)
2.6666666666666665
>>> np.nanmean(a, axis=0)
array([2.,  4.])
>>> np.nanmean(a, axis=1)
array([1.,  3.5]) # may vary
numpy.nanmedian   numpy.nanmedian(a, axis=None, out=None, overwrite_input=False, keepdims=<no value>)[source]
 
Compute the median along the specified axis, while ignoring NaNs. Returns the median of the array elements.  New in version 1.9.0.   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 a. If this is anything but the default value it will be passed through (in the special case of an empty array) to the mean function of the underlying array. If the array is a sub-class and mean does not have the kwarg keepdims this will raise a RuntimeError.    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, median, 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.0, 7, 4], [3, 2, 1]])
>>> a[0, 1] = np.nan
>>> a
array([[10., nan,  4.],
       [ 3.,  2.,  1.]])
>>> np.median(a)
nan
>>> np.nanmedian(a)
3.0
>>> np.nanmedian(a, axis=0)
array([6.5, 2. , 2.5])
>>> np.median(a, axis=1)
array([nan,  2.])
>>> b = a.copy()
>>> np.nanmedian(b, axis=1, overwrite_input=True)
array([7.,  2.])
>>> assert not np.all(a==b)
>>> b = a.copy()
>>> np.nanmedian(b, axis=None, overwrite_input=True)
3.0
>>> assert not np.all(a==b)
numpy.nanmin   numpy.nanmin(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)[source]
 
Return minimum of an array or minimum along an axis, ignoring any NaNs. When all-NaN slices are encountered a RuntimeWarning is raised and Nan is returned for that slice.  Parameters 
 
aarray_like


Array containing numbers whose minimum is desired. If a is not an array, a conversion is attempted.  
axis{int, tuple of int, None}, optional


Axis or axes along which the minimum is computed. The default is to compute the minimum of the flattened array.  
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.  New in version 1.8.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 original a. If the value is anything but the default, then keepdims will be passed through to the min method of sub-classes of ndarray. If the sub-classes methods does not implement keepdims any exceptions will be raised.  New in version 1.8.0.   
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.22.0.   
wherearray_like of bool, optional


Elements to compare for the minimum. See reduce for details.  New in version 1.22.0.     Returns 
 
nanminndarray


An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, an ndarray scalar is returned. The same dtype as a is returned.      See also  nanmax

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

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

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

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

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

Shows which elements are neither NaN nor infinity.  
amax, fmax, maximum

  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. Positive infinity is treated as a very large number and negative infinity is treated as a very small (i.e. negative) number. If the input has a integer type the function is equivalent to np.min. Examples >>> a = np.array([[1, 2], [3, np.nan]])
>>> np.nanmin(a)
1.0
>>> np.nanmin(a, axis=0)
array([1.,  2.])
>>> np.nanmin(a, axis=1)
array([1.,  3.])
 When positive infinity and negative infinity are present: >>> np.nanmin([1, 2, np.nan, np.inf])
1.0
>>> np.nanmin([1, 2, np.nan, np.NINF])
-inf
numpy.nanprod   numpy.nanprod(a, axis=None, dtype=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)[source]
 
Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones. One is returned for slices that are all-NaN or empty.  New in version 1.10.0.   Parameters 
 
aarray_like


Array containing numbers whose product is desired. If a is not an array, a conversion is attempted.  
axis{int, tuple of int, None}, optional


Axis or axes along which the product is computed. The default is to compute the product of the flattened array.  
dtypedata-type, optional


The type of the returned array and of the accumulator in which the elements are summed. By default, the dtype of a is used. An exception is when a has an integer type with less precision than the platform (u)intp. In that case, the default will be either (u)int32 or (u)int64 depending on whether the platform is 32 or 64 bits. For inexact inputs, dtype must be inexact.  
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. The casting of NaN to integer can yield unexpected results.  
keepdimsbool, optional


If 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.  
initialscalar, optional


The starting value for this product. See reduce for details.  New in version 1.22.0.   
wherearray_like of bool, optional


Elements to include in the product. See reduce for details.  New in version 1.22.0.     Returns 
 
nanprodndarray


A new array holding the result is returned unless out is specified, in which case it is returned.      See also  numpy.prod

Product across array propagating NaNs.  isnan

Show which elements are NaN.    Examples >>> np.nanprod(1)
1
>>> np.nanprod([1])
1
>>> np.nanprod([1, np.nan])
1.0
>>> a = np.array([[1, 2], [3, np.nan]])
>>> np.nanprod(a)
6.0
>>> np.nanprod(a, axis=0)
array([3., 2.])
numpy.nansum   numpy.nansum(a, axis=None, dtype=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)[source]
 
Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. In NumPy versions <= 1.9.0 Nan is returned for slices that are all-NaN or empty. In later versions zero is returned.  Parameters 
 
aarray_like


Array containing numbers whose sum is desired. If a is not an array, a conversion is attempted.  
axis{int, tuple of int, None}, optional


Axis or axes along which the sum is computed. The default is to compute the sum of the flattened array.  
dtypedata-type, optional


The type of the returned array and of the accumulator in which the elements are summed. By default, the dtype of a is used. An exception is when a has an integer type with less precision than the platform (u)intp. In that case, the default will be either (u)int32 or (u)int64 depending on whether the platform is 32 or 64 bits. For inexact inputs, dtype must be inexact.  New in version 1.8.0.   
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. The casting of NaN to integer can yield unexpected results.  New in version 1.8.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 original a. If the value is anything but the default, then keepdims will be passed through to the mean or sum methods of sub-classes of ndarray. If the sub-classes methods does not implement keepdims any exceptions will be raised.  New in version 1.8.0.   
initialscalar, optional


Starting value for the sum. See reduce for details.  New in version 1.22.0.   
wherearray_like of bool, optional


Elements to include in the sum. See reduce for details.  New in version 1.22.0.     Returns 
 
nansumndarray.


A new array holding the result is returned unless out is specified, in which it is returned. The result has the same size as a, and the same shape as a if axis is not None or a is a 1-d array.      See also  numpy.sum

Sum across array propagating NaNs.  isnan

Show which elements are NaN.  isfinite

Show which elements are not NaN or +/-inf.    Notes If both positive and negative infinity are present, the sum will be Not A Number (NaN). Examples >>> np.nansum(1)
1
>>> np.nansum([1])
1
>>> np.nansum([1, np.nan])
1.0
>>> a = np.array([[1, 1], [1, np.nan]])
>>> np.nansum(a)
3.0
>>> np.nansum(a, axis=0)
array([2.,  1.])
>>> np.nansum([1, np.nan, np.inf])
inf
>>> np.nansum([1, np.nan, np.NINF])
-inf
>>> from numpy.testing import suppress_warnings
>>> with suppress_warnings() as sup:
...     sup.filter(RuntimeWarning)
...     np.nansum([1, np.nan, np.inf, -np.inf]) # both +/- infinity present
nan
numpy.ndenumerate   class numpy.ndenumerate(arr)[source]
 
Multidimensional index iterator. Return an iterator yielding pairs of array coordinates and values.  Parameters 
 
arrndarray


Input array.      See also  
ndindex, flatiter

  Examples >>> a = np.array([[1, 2], [3, 4]])
>>> for index, x in np.ndenumerate(a):
...     print(index, x)
(0, 0) 1
(0, 1) 2
(1, 0) 3
(1, 1) 4
numpy.ndindex   class numpy.ndindex(*shape)[source]
 
An N-dimensional iterator object to index arrays. Given the shape of an array, an ndindex instance iterates over the N-dimensional index of the array. At each iteration a tuple of indices is returned, the last dimension is iterated over first.  Parameters 
 
shapeints, or a single tuple of ints


The size of each dimension of the array can be passed as individual parameters or as the elements of a tuple.      See also  
ndenumerate, flatiter

  Examples Dimensions as individual arguments >>> for index in np.ndindex(3, 2, 1):
...     print(index)
(0, 0, 0)
(0, 1, 0)
(1, 0, 0)
(1, 1, 0)
(2, 0, 0)
(2, 1, 0)
 Same dimensions - but in a tuple (3, 2, 1) >>> for index in np.ndindex((3, 2, 1)):
...     print(index)
(0, 0, 0)
(0, 1, 0)
(1, 0, 0)
(1, 1, 0)
(2, 0, 0)
(2, 1, 0)
 Methods  
ndincr() Increment the multi-dimensional index by one.
numpy.negative   numpy.negative(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'negative'>
 
Numerical negative, element-wise.  Parameters 
 
xarray_like or scalar


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 
 
yndarray or scalar


Returned array or scalar: y = -x. This is a scalar if x is a scalar.     Examples >>> np.negative([1.,-1.])
array([-1.,  1.])
 The unary - operator can be used as a shorthand for np.negative on ndarrays. >>> x1 = np.array(([1., -1.]))
>>> -x1
array([-1.,  1.])