neulab/docprompting-conala huggingface dataset:
numpy.nested_iters   numpy.nested_iters(op, axes, flags=None, op_flags=None, op_dtypes=None, order='K', casting='safe', buffersize=0)
 
Create nditers for use in nested loops Create a tuple of nditer objects which iterate in nested loops over different axes of the op argument. The first iterator is used in the outermost loop, the last in the innermost loop. Advancing one will change the subsequent iterators to point at its new element.  Parameters 
 
opndarray or sequence of array_like


The array(s) to iterate over.  
axeslist of list of int


Each item is used as an “op_axes” argument to an nditer  flags, op_flags, op_dtypes, order, casting, buffersize (optional)

See nditer parameters of the same name    Returns 
 
iterstuple of nditer


An nditer for each item in axes, outermost first      See also  nditer
  Examples Basic usage. Note how y is the “flattened” version of [a[:, 0, :], a[:, 1, 0], a[:, 2, :]] since we specified the first iter’s axes as [1] >>> a = np.arange(12).reshape(2, 3, 2)
>>> i, j = np.nested_iters(a, [[1], [0, 2]], flags=["multi_index"])
>>> for x in i:
...      print(i.multi_index)
...      for y in j:
...          print('', j.multi_index, y)
(0,)
 (0, 0) 0
 (0, 1) 1
 (1, 0) 6
 (1, 1) 7
(1,)
 (0, 0) 2
 (0, 1) 3
 (1, 0) 8
 (1, 1) 9
(2,)
 (0, 0) 4
 (0, 1) 5
 (1, 0) 10
 (1, 1) 11
numpy.newaxis
 
A convenient alias for None, useful for indexing arrays. Examples >>> newaxis is None
True
>>> x = np.arange(3)
>>> x
array([0, 1, 2])
>>> x[:, newaxis]
array([[0],
[1],
[2]])
>>> x[:, newaxis, newaxis]
array([[[0]],
[[1]],
[[2]]])
>>> x[:, newaxis] * x
array([[0, 0, 0],
[0, 1, 2],
[0, 2, 4]])
 Outer product, same as outer(x, y): >>> y = np.arange(3, 6)
>>> x[:, newaxis] * y
array([[ 0,  0,  0],
[ 3,  4,  5],
[ 6,  8, 10]])
 x[newaxis, :] is equivalent to x[newaxis] and x[None]: >>> x[newaxis, :].shape
(1, 3)
>>> x[newaxis].shape
(1, 3)
>>> x[None].shape
(1, 3)
>>> x[:, newaxis].shape
(3, 1)
numpy.nextafter   numpy.nextafter(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'nextafter'>
 
Return the next floating-point value after x1 towards x2, element-wise.  Parameters 
 
x1array_like


Values to find the next representable value of.  
x2array_like


The direction where to look for the next representable value of x1. 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 
 
outndarray or scalar


The next representable values of x1 in the direction of x2. This is a scalar if both x1 and x2 are scalars.     Examples >>> eps = np.finfo(np.float64).eps
>>> np.nextafter(1, 2) == eps + 1
True
>>> np.nextafter([1, 2], [2, 1]) == [eps + 1, 2 - eps]
array([ True,  True])
numpy.NINF
 
IEEE 754 floating point representation of negative infinity. Returns  yfloat


A floating point representation of negative infinity.   See Also isinf : Shows which elements are positive or negative infinity isposinf : Shows which elements are positive infinity isneginf : Shows which elements are negative infinity 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. Also that positive infinity is not equivalent to negative infinity. But infinity is equivalent to positive infinity. Examples >>> np.NINF
-inf
>>> np.log(0)
-inf
numpy.nonzero   numpy.nonzero(a)[source]
 
Return the indices of the elements that are non-zero. Returns a tuple of arrays, one for each dimension of a, containing the indices of the non-zero elements in that dimension. The values in a are always tested and returned in row-major, C-style order. To group the indices by element, rather than dimension, use argwhere, which returns a row for each non-zero element.  Note When called on a zero-d array or scalar, nonzero(a) is treated as nonzero(atleast_1d(a)).  Deprecated since version 1.17.0: Use atleast_1d explicitly if this behavior is deliberate.    Parameters 
 
aarray_like


Input array.    Returns 
 
tuple_of_arraystuple


Indices of elements that are non-zero.      See also  flatnonzero

Return indices that are non-zero in the flattened version of the input array.  ndarray.nonzero

Equivalent ndarray method.  count_nonzero

Counts the number of non-zero elements in the input array.    Notes While the nonzero values can be obtained with a[nonzero(a)], it is recommended to use x[x.astype(bool)] or x[x != 0] instead, which will correctly handle 0-d arrays. Examples >>> x = np.array([[3, 0, 0], [0, 4, 0], [5, 6, 0]])
>>> x
array([[3, 0, 0],
       [0, 4, 0],
       [5, 6, 0]])
>>> np.nonzero(x)
(array([0, 1, 2, 2]), array([0, 1, 0, 1]))
 >>> x[np.nonzero(x)]
array([3, 4, 5, 6])
>>> np.transpose(np.nonzero(x))
array([[0, 0],
       [1, 1],
       [2, 0],
       [2, 1]])
 A common use for nonzero is to find the indices of an array, where a condition is True. Given an array a, the condition a > 3 is a boolean array and since False is interpreted as 0, np.nonzero(a > 3) yields the indices of the a where the condition is true. >>> a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> a > 3
array([[False, False, False],
       [ True,  True,  True],
       [ True,  True,  True]])
>>> np.nonzero(a > 3)
(array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))
 Using this result to index a is equivalent to using the mask directly: >>> a[np.nonzero(a > 3)]
array([4, 5, 6, 7, 8, 9])
>>> a[a > 3]  # prefer this spelling
array([4, 5, 6, 7, 8, 9])
 nonzero can also be called as a method of the array. >>> (a > 3).nonzero()
(array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))
numpy.not_equal   numpy.not_equal(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'not_equal'>
 
Return (x1 != x2) element-wise.  Parameters 
 
x1, x2array_like


Input arrays. 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 
 
outndarray or scalar


Output array, element-wise comparison of x1 and x2. Typically of type bool, unless dtype=object is passed. This is a scalar if both x1 and x2 are scalars.      See also  
equal, greater, greater_equal, less, less_equal

  Examples >>> np.not_equal([1.,2.], [1., 3.])
array([False,  True])
>>> np.not_equal([1, 2], [[1, 3],[1, 4]])
array([[False,  True],
       [False,  True]])
 The != operator can be used as a shorthand for np.not_equal on ndarrays. >>> a = np.array([1., 2.])
>>> b = np.array([1., 3.])
>>> a != b
array([False,  True])
numpy.NZERO
 
IEEE 754 floating point representation of negative zero. Returns  yfloat


A floating point representation of negative zero.   See Also PZERO : Defines positive zero. isinf : Shows which elements are positive or negative infinity. isposinf : Shows which elements are positive infinity. isneginf : Shows which elements are negative infinity. isnan : Shows which elements are Not a Number.  isfiniteShows 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). Negative zero is considered to be a finite number. Examples >>> np.NZERO
-0.0
>>> np.PZERO
0.0
 >>> np.isfinite([np.NZERO])
array([ True])
>>> np.isnan([np.NZERO])
array([False])
>>> np.isinf([np.NZERO])
array([False])
numpy.obj2sctype   numpy.obj2sctype(rep, default=None)[source]
 
Return the scalar dtype or NumPy equivalent of Python type of an object.  Parameters 
 
repany


The object of which the type is returned.  
defaultany, optional


If given, this is returned for objects whose types can not be determined. If not given, None is returned for those objects.    Returns 
 
dtypedtype or Python type


The data type of rep.      See also  
sctype2char, issctype, issubsctype, issubdtype, maximum_sctype

  Examples >>> np.obj2sctype(np.int32)
<class 'numpy.int32'>
>>> np.obj2sctype(np.array([1., 2.]))
<class 'numpy.float64'>
>>> np.obj2sctype(np.array([1.j]))
<class 'numpy.complex128'>
 >>> np.obj2sctype(dict)
<class 'numpy.object_'>
>>> np.obj2sctype('string')
 >>> np.obj2sctype(1, default=list)
<class 'list'>
class numpy.object_[source]
 
Any Python object.  Character code 
'O'
numpy.ogrid   numpy.ogrid = <numpy.lib.index_tricks.OGridClass object>
 
nd_grid instance which returns an open multi-dimensional “meshgrid”. An instance of numpy.lib.index_tricks.nd_grid which returns an open (i.e. not fleshed out) mesh-grid when indexed, so that only one dimension of each returned array is greater than 1. The dimension 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 with only one dimension not equal to 1      See also  np.lib.index_tricks.nd_grid

class of ogrid and mgrid objects  mgrid

like ogrid but returns dense (or fleshed out) mesh grids  r_

array concatenator    Examples >>> from numpy import ogrid
>>> ogrid[-1:1:5j]
array([-1. , -0.5,  0. ,  0.5,  1. ])
>>> ogrid[0:5,0:5]
[array([[0],
        [1],
        [2],
        [3],
        [4]]), array([[0, 1, 2, 3, 4]])]
numpy.ones   numpy.ones(shape, dtype=None, order='C', *, like=None)[source]
 
Return a new array of given shape and type, filled with ones.  Parameters 
 
shapeint or sequence of ints


Shape of the new array, e.g., (2, 3) or 2.  
dtypedata-type, optional


The desired data-type for the array, e.g., numpy.int8. Default is numpy.float64.  
order{‘C’, ‘F’}, optional, default: C


Whether to store multi-dimensional data in row-major (C-style) or column-major (Fortran-style) order in memory.  
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 
 
outndarray


Array of ones with the given shape, dtype, and order.      See also  ones_like

Return an array of ones with shape and type of input.  empty

Return a new uninitialized array.  zeros

Return a new array setting values to zero.  full

Return a new array of given shape filled with value.    Examples >>> np.ones(5)
array([1., 1., 1., 1., 1.])
 >>> np.ones((5,), dtype=int)
array([1, 1, 1, 1, 1])
 >>> np.ones((2, 1))
array([[1.],
       [1.]])
 >>> s = (2,2)
>>> np.ones(s)
array([[1.,  1.],
       [1.,  1.]])
numpy.ones_like   numpy.ones_like(a, dtype=None, order='K', subok=True, shape=None)[source]
 
Return an array of ones with the same shape and type as a given array.  Parameters 
 
aarray_like


The shape and data-type of a define these same attributes of the returned array.  
dtypedata-type, optional


Overrides the data type of the result.  New in version 1.6.0.   
order{‘C’, ‘F’, ‘A’, or ‘K’}, optional


Overrides the memory layout of the result. ‘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.  New in version 1.6.0.   
subokbool, optional.


If True, then the newly created array will use the sub-class type of a, otherwise it will be a base-class array. Defaults to True.  
shapeint or sequence of ints, optional.


Overrides the shape of the result. If order=’K’ and the number of dimensions is unchanged, will try to keep order, otherwise, order=’C’ is implied.  New in version 1.17.0.     Returns 
 
outndarray


Array of ones with the same shape and type as a.      See also  empty_like

Return an empty array with shape and type of input.  zeros_like

Return an array of zeros with shape and type of input.  full_like

Return a new array with shape of input filled with value.  ones

Return a new array setting values to one.    Examples >>> x = np.arange(6)
>>> x = x.reshape((2, 3))
>>> x
array([[0, 1, 2],
       [3, 4, 5]])
>>> np.ones_like(x)
array([[1, 1, 1],
       [1, 1, 1]])
 >>> y = np.arange(3, dtype=float)
>>> y
array([0., 1., 2.])
>>> np.ones_like(y)
array([1.,  1.,  1.])
numpy.outer   numpy.outer(a, b, out=None)[source]
 
Compute the outer product of two vectors. Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product [1] is: [[a0*b0  a0*b1 ... a0*bN ]
 [a1*b0    .
 [ ...          .
 [aM*b0            aM*bN ]]
  Parameters 
 
a(M,) array_like


First input vector. Input is flattened if not already 1-dimensional.  
b(N,) array_like


Second input vector. Input is flattened if not already 1-dimensional.  
out(M, N) ndarray, optional


A location where the result is stored  New in version 1.9.0.     Returns 
 
out(M, N) ndarray


out[i, j] = a[i] * b[j]      See also  inner
einsum

einsum('i,j->ij', a.ravel(), b.ravel()) is the equivalent.  ufunc.outer

A generalization to dimensions other than 1D and other operations. np.multiply.outer(a.ravel(), b.ravel()) is the equivalent.  tensordot

np.tensordot(a.ravel(), b.ravel(), axes=((), ())) is the equivalent.    References  1 
: G. H. Golub and C. F. Van Loan, Matrix Computations, 3rd ed., Baltimore, MD, Johns Hopkins University Press, 1996, pg. 8.   Examples Make a (very coarse) grid for computing a Mandelbrot set: >>> rl = np.outer(np.ones((5,)), np.linspace(-2, 2, 5))
>>> rl
array([[-2., -1.,  0.,  1.,  2.],
       [-2., -1.,  0.,  1.,  2.],
       [-2., -1.,  0.,  1.,  2.],
       [-2., -1.,  0.,  1.,  2.],
       [-2., -1.,  0.,  1.,  2.]])
>>> im = np.outer(1j*np.linspace(2, -2, 5), np.ones((5,)))
>>> im
array([[0.+2.j, 0.+2.j, 0.+2.j, 0.+2.j, 0.+2.j],
       [0.+1.j, 0.+1.j, 0.+1.j, 0.+1.j, 0.+1.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.-1.j, 0.-1.j, 0.-1.j, 0.-1.j, 0.-1.j],
       [0.-2.j, 0.-2.j, 0.-2.j, 0.-2.j, 0.-2.j]])
>>> grid = rl + im
>>> grid
array([[-2.+2.j, -1.+2.j,  0.+2.j,  1.+2.j,  2.+2.j],
       [-2.+1.j, -1.+1.j,  0.+1.j,  1.+1.j,  2.+1.j],
       [-2.+0.j, -1.+0.j,  0.+0.j,  1.+0.j,  2.+0.j],
       [-2.-1.j, -1.-1.j,  0.-1.j,  1.-1.j,  2.-1.j],
       [-2.-2.j, -1.-2.j,  0.-2.j,  1.-2.j,  2.-2.j]])
 An example using a “vector” of letters: >>> x = np.array(['a', 'b', 'c'], dtype=object)
>>> np.outer(x, [1, 2, 3])
array([['a', 'aa', 'aaa'],
       ['b', 'bb', 'bbb'],
       ['c', 'cc', 'ccc']], dtype=object)
numpy.packbits   numpy.packbits(a, /, axis=None, bitorder='big')
 
Packs the elements of a binary-valued array into bits in a uint8 array. The result is padded to full bytes by inserting zero bits at the end.  Parameters 
 
aarray_like


An array of integers or booleans whose elements should be packed to bits.  
axisint, optional


The dimension over which bit-packing is done. None implies packing the flattened array.  
bitorder{‘big’, ‘little’}, optional


The order of the input bits. ‘big’ will mimic bin(val), [0, 0, 0, 0, 0, 0, 1, 1] => 3 = 0b00000011, ‘little’ will reverse the order so [1, 1, 0, 0, 0, 0, 0, 0] => 3. Defaults to ‘big’.  New in version 1.17.0.     Returns 
 
packedndarray


Array of type uint8 whose elements represent bits corresponding to the logical (0 or nonzero) value of the input elements. The shape of packed has the same number of dimensions as the input (unless axis is None, in which case the output is 1-D).      See also  unpackbits

Unpacks elements of a uint8 array into a binary-valued output array.    Examples >>> a = np.array([[[1,0,1],
...                [0,1,0]],
...               [[1,1,0],
...                [0,0,1]]])
>>> b = np.packbits(a, axis=-1)
>>> b
array([[[160],
        [ 64]],
       [[192],
        [ 32]]], dtype=uint8)
 Note that in binary 160 = 1010 0000, 64 = 0100 0000, 192 = 1100 0000, and 32 = 0010 0000.
numpy.partition   numpy.partition(a, kth, axis=- 1, kind='introselect', order=None)[source]
 
Return a partitioned copy of an array. Creates a copy of the array with its elements rearranged in such a way that the value of the element in k-th position is in the position it would be in a sorted array. All elements smaller than the k-th element are moved before this element and all equal or greater are moved behind it. The ordering of the elements in the two partitions is undefined.  New in version 1.8.0.   Parameters 
 
aarray_like


Array to be sorted.  
kthint or sequence of ints


Element index to partition by. The k-th value of the element will be in its final sorted position and all smaller elements will be moved before it and all equal or greater elements behind it. The order of all elements in the partitions is undefined. If provided with a sequence of k-th it will partition all elements indexed by k-th of them into their sorted position at once.  Deprecated since version 1.22.0: Passing booleans as index is deprecated.   
axisint or None, optional


Axis along which to sort. If None, the array is flattened before sorting. The default is -1, which sorts along the last axis.  
kind{‘introselect’}, optional


Selection algorithm. Default is ‘introselect’.  
orderstr or list of str, optional


When a is an array with fields defined, this argument specifies which fields to compare first, second, etc. A single field can be specified as a string. Not all fields need be specified, but unspecified fields will still be used, in the order in which they come up in the dtype, to break ties.    Returns 
 
partitioned_arrayndarray


Array of the same type and shape as a.      See also  ndarray.partition

Method to sort an array in-place.  argpartition

Indirect partition.  sort

Full sorting    Notes The various selection algorithms are characterized by their average speed, worst case performance, work space size, and whether they are stable. A stable sort keeps items with the same key in the same relative order. The available algorithms have the following properties:   
kind speed worst case work space stable   
‘introselect’ 1 O(n) 0 no   All the partition algorithms make temporary copies of the data when partitioning along any but the last axis. Consequently, partitioning along the last axis is faster and uses less space than partitioning along any other axis. The sort order for complex numbers is lexicographic. If both the real and imaginary parts are non-nan then the order is determined by the real parts except when they are equal, in which case the order is determined by the imaginary parts. Examples >>> a = np.array([3, 4, 2, 1])
>>> np.partition(a, 3)
array([2, 1, 3, 4])
 >>> np.partition(a, (1, 3))
array([1, 2, 3, 4])
numpy.pi
 
pi = 3.1415926535897932384626433... References https://en.wikipedia.org/wiki/Pi
numpy.piecewise   numpy.piecewise(x, condlist, funclist, *args, **kw)[source]
 
Evaluate a piecewise-defined function. Given a set of conditions and corresponding functions, evaluate each function on the input data wherever its condition is true.  Parameters 
 
xndarray or scalar


The input domain.  
condlistlist of bool arrays or bool scalars


Each boolean array corresponds to a function in funclist. Wherever condlist[i] is True, funclist[i](x) is used as the output value. Each boolean array in condlist selects a piece of x, and should therefore be of the same shape as x. The length of condlist must correspond to that of funclist. If one extra function is given, i.e. if len(funclist) == len(condlist) + 1, then that extra function is the default value, used wherever all conditions are false.  
funclistlist of callables, f(x,*args,**kw), or scalars


Each function is evaluated over x wherever its corresponding condition is True. It should take a 1d array as input and give an 1d array or a scalar value as output. If, instead of a callable, a scalar is provided then a constant function (lambda x: scalar) is assumed.  
argstuple, optional


Any further arguments given to piecewise are passed to the functions upon execution, i.e., if called piecewise(..., ..., 1, 'a'), then each function is called as f(x, 1, 'a').  
kwdict, optional


Keyword arguments used in calling piecewise are passed to the functions upon execution, i.e., if called piecewise(..., ..., alpha=1), then each function is called as f(x, alpha=1).    Returns 
 
outndarray


The output is the same shape and type as x and is found by calling the functions in funclist on the appropriate portions of x, as defined by the boolean arrays in condlist. Portions not covered by any condition have a default value of 0.      See also  
choose, select, where

  Notes This is similar to choose or select, except that functions are evaluated on elements of x that satisfy the corresponding condition from condlist. The result is:       |--
      |funclist[0](x[condlist[0]])
out = |funclist[1](x[condlist[1]])
      |...
      |funclist[n2](x[condlist[n2]])
      |--
 Examples Define the sigma function, which is -1 for x < 0 and +1 for x >= 0. >>> x = np.linspace(-2.5, 2.5, 6)
>>> np.piecewise(x, [x < 0, x >= 0], [-1, 1])
array([-1., -1., -1.,  1.,  1.,  1.])
 Define the absolute value, which is -x for x <0 and x for x >= 0. >>> np.piecewise(x, [x < 0, x >= 0], [lambda x: -x, lambda x: x])
array([2.5,  1.5,  0.5,  0.5,  1.5,  2.5])
 Apply the same function to a scalar value. >>> y = -2
>>> np.piecewise(y, [y < 0, y >= 0], [lambda x: -x, lambda x: x])
array(2)
numpy.PINF
 
IEEE 754 floating point representation of (positive) infinity. Use inf because Inf, Infinity, PINF and infty are aliases for inf. For more details, see inf. See Also inf
numpy.place   numpy.place(arr, mask, vals)[source]
 
Change elements of an array based on conditional and input values. Similar to np.copyto(arr, vals, where=mask), the difference is that place uses the first N elements of vals, where N is the number of True values in mask, while copyto uses the elements where mask is True. Note that extract does the exact opposite of place.  Parameters 
 
arrndarray


Array to put data into.  
maskarray_like


Boolean mask array. Must have the same size as a.  
vals1-D sequence


Values to put into a. Only the first N elements are used, where N is the number of True values in mask. If vals is smaller than N, it will be repeated, and if elements of a are to be masked, this sequence must be non-empty.      See also  
copyto, put, take, extract

  Examples >>> arr = np.arange(6).reshape(2, 3)
>>> np.place(arr, arr>2, [44, 55])
>>> arr
array([[ 0,  1,  2],
       [44, 55, 44]])