neulab/docprompting-conala huggingface dataset:
numpy.ma.atleast_1d   ma.atleast_1d(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_allargs object>
 
Convert inputs to arrays with at least one dimension. Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.  Parameters 
 
arys1, arys2, …array_like


One or more input arrays.    Returns 
 
retndarray


An array, or list of arrays, each with a.ndim >= 1. Copies are made only if necessary.      See also  
atleast_2d, atleast_3d

  Notes The function is applied to both the _data and the _mask, if any. Examples >>> np.atleast_1d(1.0)
array([1.])
 >>> x = np.arange(9.0).reshape(3,3)
>>> np.atleast_1d(x)
array([[0., 1., 2.],
       [3., 4., 5.],
       [6., 7., 8.]])
>>> np.atleast_1d(x) is x
True
 >>> np.atleast_1d(1, [3, 4])
[array([1]), array([3, 4])]
numpy.ma.atleast_2d   ma.atleast_2d(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_allargs object>
 
View inputs as arrays with at least two dimensions.  Parameters 
 
arys1, arys2, …array_like


One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.    Returns 
 
res, res2, …ndarray


An array, or list of arrays, each with a.ndim >= 2. Copies are avoided where possible, and views with two or more dimensions are returned.      See also  
atleast_1d, atleast_3d

  Notes The function is applied to both the _data and the _mask, if any. Examples >>> np.atleast_2d(3.0)
array([[3.]])
 >>> x = np.arange(3.0)
>>> np.atleast_2d(x)
array([[0., 1., 2.]])
>>> np.atleast_2d(x).base is x
True
 >>> np.atleast_2d(1, [1, 2], [[1, 2]])
[array([[1]]), array([[1, 2]]), array([[1, 2]])]
numpy.ma.atleast_3d   ma.atleast_3d(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_allargs object>
 
View inputs as arrays with at least three dimensions.  Parameters 
 
arys1, arys2, …array_like


One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have three or more dimensions are preserved.    Returns 
 
res1, res2, …ndarray


An array, or list of arrays, each with a.ndim >= 3. Copies are avoided where possible, and views with three or more dimensions are returned. For example, a 1-D array of shape (N,) becomes a view of shape (1, N, 1), and a 2-D array of shape (M, N) becomes a view of shape (M, N, 1).      See also  
atleast_1d, atleast_2d

  Notes The function is applied to both the _data and the _mask, if any. Examples >>> np.atleast_3d(3.0)
array([[[3.]]])
 >>> x = np.arange(3.0)
>>> np.atleast_3d(x).shape
(1, 3, 1)
 >>> x = np.arange(12.0).reshape(4,3)
>>> np.atleast_3d(x).shape
(4, 3, 1)
>>> np.atleast_3d(x).base is x.base  # x is a reshape, so not base itself
True
 >>> for arr in np.atleast_3d([1, 2], [[1, 2]], [[[1, 2]]]):
...     print(arr, arr.shape) 
...
[[[1]
  [2]]] (1, 2, 1)
[[[1]
  [2]]] (1, 2, 1)
[[[1 2]]] (1, 1, 2)
numpy.ma.average   ma.average(a, axis=None, weights=None, returned=False)[source]
 
Return the weighted average of array over the given axis.  Parameters 
 
aarray_like


Data to be averaged. Masked entries are not taken into account in the computation.  
axisint, optional


Axis along which to average a. If None, averaging is done over the flattened array.  
weightsarray_like, optional


The importance that each element has in the computation of the average. The weights array can either be 1-D (in which case its length must be the size of a along the given axis) or of the same shape as a. If weights=None, then all data in a are assumed to have a weight equal to one. The 1-D calculation is: avg = sum(a * weights) / sum(weights)
 The only constraint on weights is that sum(weights) must not be 0.  
returnedbool, optional


Flag indicating whether a tuple (result, sum of weights) should be returned as output (True), or just the result (False). Default is False.    Returns 
 
average, [sum_of_weights](tuple of) scalar or MaskedArray


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 np.float64 if a is of integer type and floats smaller than float64, or the input data-type, otherwise. If returned, sum_of_weights is always float64.     Examples >>> a = np.ma.array([1., 2., 3., 4.], mask=[False, False, True, True])
>>> np.ma.average(a, weights=[3, 1, 0, 0])
1.25
 >>> x = np.ma.arange(6.).reshape(3, 2)
>>> x
masked_array(
  data=[[0., 1.],
        [2., 3.],
        [4., 5.]],
  mask=False,
  fill_value=1e+20)
>>> avg, sumweights = np.ma.average(x, axis=0, weights=[1, 2, 3],
...                                 returned=True)
>>> avg
masked_array(data=[2.6666666666666665, 3.6666666666666665],
             mask=[False, False],
       fill_value=1e+20)
numpy.ma.choose   ma.choose(indices, choices, out=None, mode='raise')[source]
 
Use an index array to construct a new array from a list of choices. Given an array of integers and a list of n choice arrays, this method will create a new array that merges each of the choice arrays. Where a value in index is i, the new array will have the value that choices[i] contains in the same place.  Parameters 
 
indicesndarray of ints


This array must contain integers in [0, n-1], where n is the number of choices.  
choicessequence of arrays


Choice arrays. The index array and all of the choices should be broadcastable to the same shape.  
outarray, optional


If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype.  
mode{‘raise’, ‘wrap’, ‘clip’}, optional


Specifies how out-of-bounds indices will behave.  ‘raise’ : raise an error ‘wrap’ : wrap around ‘clip’ : clip to the range     Returns 
 
merged_arrayarray

    See also  choose

equivalent function    Examples >>> choice = np.array([[1,1,1], [2,2,2], [3,3,3]])
>>> a = np.array([2, 1, 0])
>>> np.ma.choose(a, choice)
masked_array(data=[3, 2, 1],
             mask=False,
       fill_value=999999)
numpy.ma.clip   ma.clip(*args, **kwargs) = <numpy.ma.core._convert2ma object>
 
Clip (limit) the values in an array. Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. Equivalent to but faster than np.minimum(a_max, np.maximum(a, a_min)). No check is performed to ensure a_min < a_max.  Parameters 
 
aarray_like


Array containing elements to clip.  
a_min, a_maxarray_like or None


Minimum and maximum value. If None, clipping is not performed on the corresponding edge. Only one of a_min and a_max may be None. Both are broadcast against a.  
outndarray, optional


The results will be placed in this array. It may be the input array for in-place clipping. out must be of the right shape to hold the output. Its type is preserved.  **kwargs

For other keyword-only arguments, see the ufunc docs.  New in version 1.17.0.     Returns 
 
clipped_arrayMaskedArray


An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.      See also  Output type determination
  Notes When a_min is greater than a_max, clip returns an array in which all values are equal to a_max, as shown in the second example. Examples >>> a = np.arange(10)
>>> a
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> np.clip(a, 1, 8)
array([1, 1, 2, 3, 4, 5, 6, 7, 8, 8])
>>> np.clip(a, 8, 1)
array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
>>> np.clip(a, 3, 6, out=a)
array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
>>> a
array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
>>> a = np.arange(10)
>>> a
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> np.clip(a, [3, 4, 1, 1, 1, 4, 4, 4, 4, 4], 8)
array([3, 4, 2, 3, 4, 5, 6, 7, 8, 8])
numpy.ma.clump_masked   ma.clump_masked(a)[source]
 
Returns a list of slices corresponding to the masked clumps of a 1-D array. (A “clump” is defined as a contiguous region of the array).  Parameters 
 
andarray


A one-dimensional masked array.    Returns 
 
sliceslist of slice


The list of slices, one for each continuous region of masked elements in a.      See also  
flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges


notmasked_contiguous, clump_unmasked

  Notes  New in version 1.4.0.  Examples >>> a = np.ma.masked_array(np.arange(10))
>>> a[[0, 1, 2, 6, 8, 9]] = np.ma.masked
>>> np.ma.clump_masked(a)
[slice(0, 3, None), slice(6, 7, None), slice(8, 10, None)]
numpy.ma.clump_unmasked   ma.clump_unmasked(a)[source]
 
Return list of slices corresponding to the unmasked clumps of a 1-D array. (A “clump” is defined as a contiguous region of the array).  Parameters 
 
andarray


A one-dimensional masked array.    Returns 
 
sliceslist of slice


The list of slices, one for each continuous region of unmasked elements in a.      See also  
flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges


notmasked_contiguous, clump_masked

  Notes  New in version 1.4.0.  Examples >>> a = np.ma.masked_array(np.arange(10))
>>> a[[0, 1, 2, 6, 8, 9]] = np.ma.masked
>>> np.ma.clump_unmasked(a)
[slice(3, 6, None), slice(7, 8, None)]
numpy.ma.column_stack   ma.column_stack(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_seq object>
 
Stack 1-D arrays as columns into a 2-D array. Take a sequence of 1-D arrays and stack them as columns to make a single 2-D array. 2-D arrays are stacked as-is, just like with hstack. 1-D arrays are turned into 2-D columns first.  Parameters 
 
tupsequence of 1-D or 2-D arrays.


Arrays to stack. All of them must have the same first dimension.    Returns 
 
stacked2-D array


The array formed by stacking the given arrays.      See also  
stack, hstack, vstack, concatenate

  Notes The function is applied to both the _data and the _mask, if any. Examples >>> a = np.array((1,2,3))
>>> b = np.array((2,3,4))
>>> np.column_stack((a,b))
array([[1, 2],
       [2, 3],
       [3, 4]])
numpy.ma.common_fill_value   ma.common_fill_value(a, b)[source]
 
Return the common filling value of two masked arrays, if any. If a.fill_value == b.fill_value, return the fill value, otherwise return None.  Parameters 
 
a, bMaskedArray


The masked arrays for which to compare fill values.    Returns 
 
fill_valuescalar or None


The common fill value, or None.     Examples >>> x = np.ma.array([0, 1.], fill_value=3)
>>> y = np.ma.array([0, 1.], fill_value=3)
>>> np.ma.common_fill_value(x, y)
3.0
numpy.ma.compress_cols   ma.compress_cols(a)[source]
 
Suppress whole columns of a 2-D array that contain masked values. This is equivalent to np.ma.compress_rowcols(a, 1), see compress_rowcols for details.  See also  compress_rowcols
numpy.ma.compress_rowcols   ma.compress_rowcols(x, axis=None)[source]
 
Suppress the rows and/or columns of a 2-D array that contain masked values. The suppression behavior is selected with the axis parameter.  If axis is None, both rows and columns are suppressed. If axis is 0, only rows are suppressed. If axis is 1 or -1, only columns are suppressed.   Parameters 
 
xarray_like, MaskedArray


The array to operate on. If not a MaskedArray instance (or if no array elements are masked), x is interpreted as a MaskedArray with mask set to nomask. Must be a 2D array.  
axisint, optional


Axis along which to perform the operation. Default is None.    Returns 
 
compressed_arrayndarray


The compressed array.     Examples >>> x = np.ma.array(np.arange(9).reshape(3, 3), mask=[[1, 0, 0],
...                                                   [1, 0, 0],
...                                                   [0, 0, 0]])
>>> x
masked_array(
  data=[[--, 1, 2],
        [--, 4, 5],
        [6, 7, 8]],
  mask=[[ True, False, False],
        [ True, False, False],
        [False, False, False]],
  fill_value=999999)
 >>> np.ma.compress_rowcols(x)
array([[7, 8]])
>>> np.ma.compress_rowcols(x, 0)
array([[6, 7, 8]])
>>> np.ma.compress_rowcols(x, 1)
array([[1, 2],
       [4, 5],
       [7, 8]])
numpy.ma.compress_rows   ma.compress_rows(a)[source]
 
Suppress whole rows of a 2-D array that contain masked values. This is equivalent to np.ma.compress_rowcols(a, 0), see compress_rowcols for details.  See also  compress_rowcols
numpy.ma.compressed   ma.compressed(x)[source]
 
Return all the non-masked data as a 1-D array. This function is equivalent to calling the “compressed” method of a ma.MaskedArray, see ma.MaskedArray.compressed for details.  See also  ma.MaskedArray.compressed

Equivalent method.
numpy.ma.concatenate   ma.concatenate(arrays, axis=0)[source]
 
Concatenate a sequence of arrays along the given axis.  Parameters 
 
arrayssequence of array_like


The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).  
axisint, optional


The axis along which the arrays will be joined. Default is 0.    Returns 
 
resultMaskedArray


The concatenated array with any masked entries preserved.      See also  numpy.concatenate

Equivalent function in the top-level NumPy module.    Examples >>> import numpy.ma as ma
>>> a = ma.arange(3)
>>> a[1] = ma.masked
>>> b = ma.arange(2, 5)
>>> a
masked_array(data=[0, --, 2],
             mask=[False,  True, False],
       fill_value=999999)
>>> b
masked_array(data=[2, 3, 4],
             mask=False,
       fill_value=999999)
>>> ma.concatenate([a, b])
masked_array(data=[0, --, 2, 2, 3, 4],
             mask=[False,  True, False, False, False, False],
       fill_value=999999)
numpy.ma.conjugate   ma.conjugate(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <numpy.ma.core._MaskedUnaryOperation object>
 
Return the complex conjugate, element-wise. The complex conjugate of a complex number is obtained by changing the sign of its imaginary part.  Parameters 
 
xarray_like


Input value.  
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 complex conjugate of x, with same dtype as y. This is a scalar if x is a scalar.     Notes conj is an alias for conjugate: >>> np.conj is np.conjugate
True
 Examples >>> np.conjugate(1+2j)
(1-2j)
 >>> x = np.eye(2) + 1j * np.eye(2)
>>> np.conjugate(x)
array([[ 1.-1.j,  0.-0.j],
       [ 0.-0.j,  1.-1.j]])
numpy.ma.copy   ma.copy(self, *args, **params) a.copy(order='C') = <numpy.ma.core._frommethod object>
  Return a copy of the array.  Parameters 
 
order{‘C’, ‘F’, ‘A’, ‘K’}, optional


Controls the memory layout of the copy. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ means match the layout of a as closely as possible. (Note that this function and numpy.copy are very similar but have different default values for their order= arguments, and this function always passes sub-classes through.)      See also  numpy.copy

Similar function with different default behavior numpy.copyto    Notes This function is the preferred method for creating an array copy. The function numpy.copy is similar, but it defaults to using order ‘K’, and will not pass sub-classes through by default. Examples >>> x = np.array([[1,2,3],[4,5,6]], order='F')
 >>> y = x.copy()
 >>> x.fill(0)
 >>> x
array([[0, 0, 0],
       [0, 0, 0]])
 >>> y
array([[1, 2, 3],
       [4, 5, 6]])
 >>> y.flags['C_CONTIGUOUS']
True
numpy.ma.corrcoef   ma.corrcoef(x, y=None, rowvar=True, bias=<no value>, allow_masked=True, ddof=<no value>)[source]
 
Return Pearson product-moment correlation coefficients. Except for the handling of missing data this function does the same as numpy.corrcoef. For more details and examples, see numpy.corrcoef.  Parameters 
 
xarray_like


A 1-D or 2-D array containing multiple variables and observations. Each row of x represents a variable, and each column a single observation of all those variables. Also see rowvar below.  
yarray_like, optional


An additional set of variables and observations. y has the same shape as x.  
rowvarbool, optional


If rowvar is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.  
bias_NoValue, optional


Has no effect, do not use.  Deprecated since version 1.10.0.   
allow_maskedbool, optional


If True, masked values are propagated pair-wise: if a value is masked in x, the corresponding value is masked in y. If False, raises an exception. Because bias is deprecated, this argument needs to be treated as keyword only to avoid a warning.  
ddof_NoValue, optional


Has no effect, do not use.  Deprecated since version 1.10.0.       See also  numpy.corrcoef

Equivalent function in top-level NumPy module.  cov

Estimate the covariance matrix.    Notes This function accepts but discards arguments bias and ddof. This is for backwards compatibility with previous versions of this function. These arguments had no effect on the return values of the function and can be safely ignored in this and previous versions of numpy.
numpy.ma.count   ma.count(self, axis=None, keepdims=<no value>) = <numpy.ma.core._frommethod object>
 
Count the non-masked elements of the array along the given axis.  Parameters 
 
axisNone or int or tuple of ints, optional


Axis or axes along which the count is performed. The default, None, performs the count 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.10.0.  If this is a tuple of ints, the count is performed on multiple axes, instead of a single axis or all the axes as before.  
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.    Returns 
 
resultndarray or scalar


An array with the same shape as the input array, with the specified axis removed. If the array is a 0-d array, or if axis is None, a scalar is returned.      See also  ma.count_masked

Count masked elements in array or along a given axis.    Examples >>> import numpy.ma as ma
>>> a = ma.arange(6).reshape((2, 3))
>>> a[1, :] = ma.masked
>>> a
masked_array(
  data=[[0, 1, 2],
        [--, --, --]],
  mask=[[False, False, False],
        [ True,  True,  True]],
  fill_value=999999)
>>> a.count()
3
 When the axis keyword is specified an array of appropriate size is returned. >>> a.count(axis=0)
array([1, 1, 1])
>>> a.count(axis=1)
array([3, 0])
numpy.ma.count_masked   ma.count_masked(arr, axis=None)[source]
 
Count the number of masked elements along the given axis.  Parameters 
 
arrarray_like


An array with (possibly) masked elements.  
axisint, optional


Axis along which to count. If None (default), a flattened version of the array is used.    Returns 
 
countint, ndarray


The total number of masked elements (axis=None) or the number of masked elements along each slice of the given axis.      See also  MaskedArray.count

Count non-masked elements.    Examples >>> import numpy.ma as ma
>>> a = np.arange(9).reshape((3,3))
>>> a = ma.array(a)
>>> a[1, 0] = ma.masked
>>> a[1, 2] = ma.masked
>>> a[2, 1] = ma.masked
>>> a
masked_array(
  data=[[0, 1, 2],
        [--, 4, --],
        [6, --, 8]],
  mask=[[False, False, False],
        [ True, False,  True],
        [False,  True, False]],
  fill_value=999999)
>>> ma.count_masked(a)
3
 When the axis keyword is used an array is returned. >>> ma.count_masked(a, axis=0)
array([1, 1, 1])
>>> ma.count_masked(a, axis=1)
array([0, 2, 1])
numpy.ma.cov   ma.cov(x, y=None, rowvar=True, bias=False, allow_masked=True, ddof=None)[source]
 
Estimate the covariance matrix. Except for the handling of missing data this function does the same as numpy.cov. For more details and examples, see numpy.cov. By default, masked values are recognized as such. If x and y have the same shape, a common mask is allocated: if x[i,j] is masked, then y[i,j] will also be masked. Setting allow_masked to False will raise an exception if values are missing in either of the input arrays.  Parameters 
 
xarray_like


A 1-D or 2-D array containing multiple variables and observations. Each row of x represents a variable, and each column a single observation of all those variables. Also see rowvar below.  
yarray_like, optional


An additional set of variables and observations. y has the same shape as x.  
rowvarbool, optional


If rowvar is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.  
biasbool, optional


Default normalization (False) is by (N-1), where N is the number of observations given (unbiased estimate). If bias is True, then normalization is by N. This keyword can be overridden by the keyword ddof in numpy versions >= 1.5.  
allow_maskedbool, optional


If True, masked values are propagated pair-wise: if a value is masked in x, the corresponding value is masked in y. If False, raises a ValueError exception when some values are missing.  
ddof{None, int}, optional


If not None normalization is by (N - ddof), where N is the number of observations; this overrides the value implied by bias. The default value is None.  New in version 1.5.     Raises 
 ValueError

Raised if some values are missing and allow_masked is False.      See also  numpy.cov
numpy.ma.cumprod   ma.cumprod(self, axis=None, dtype=None, out=None) = <numpy.ma.core._frommethod object>
 
Return the cumulative product of the array elements over the given axis. Masked values are set to 1 internally during the computation. However, their position is saved, and the result will be masked at the same locations. Refer to numpy.cumprod for full documentation.  See also  numpy.ndarray.cumprod

corresponding function for ndarrays  numpy.cumprod

equivalent function    Notes The mask is lost if out is not a valid MaskedArray ! Arithmetic is modular when using integer types, and no error is raised on overflow.
numpy.ma.cumsum   ma.cumsum(self, axis=None, dtype=None, out=None) = <numpy.ma.core._frommethod object>
 
Return the cumulative sum of the array elements over the given axis. Masked values are set to 0 internally during the computation. However, their position is saved, and the result will be masked at the same locations. Refer to numpy.cumsum for full documentation.  See also  numpy.ndarray.cumsum

corresponding function for ndarrays  numpy.cumsum

equivalent function    Notes The mask is lost if out is not a valid ma.MaskedArray ! Arithmetic is modular when using integer types, and no error is raised on overflow. Examples >>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
>>> marr.cumsum()
masked_array(data=[0, 1, 3, --, --, --, 9, 16, 24, 33],
             mask=[False, False, False,  True,  True,  True, False, False,
                   False, False],
       fill_value=999999)