neulab/docprompting-conala huggingface dataset:
numpy.exp   numpy.exp(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'exp'>
 
Calculate the exponential of all elements in the input array.  Parameters 
 
xarray_like


Input values.  
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 exponential of x. This is a scalar if x is a scalar.      See also  expm1

Calculate exp(x) - 1 for all elements in the array.  exp2

Calculate 2**x for all elements in the array.    Notes The irrational number e is also known as Euler’s number. It is approximately 2.718281, and is the base of the natural logarithm, ln (this means that, if \(x = \ln y = \log_e y\), then \(e^x = y\). For real input, exp(x) is always positive. For complex arguments, x = a + ib, we can write \(e^x = e^a e^{ib}\). The first term, \(e^a\), is already known (it is the real argument, described above). The second term, \(e^{ib}\), is \(\cos b + i \sin b\), a function with magnitude 1 and a periodic phase. References  1 
Wikipedia, “Exponential function”, https://en.wikipedia.org/wiki/Exponential_function  2 
M. Abramovitz and I. A. Stegun, “Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables,” Dover, 1964, p. 69, https://personal.math.ubc.ca/~cbm/aands/page_69.htm   Examples Plot the magnitude and phase of exp(x) in the complex plane: >>> import matplotlib.pyplot as plt
 >>> x = np.linspace(-2*np.pi, 2*np.pi, 100)
>>> xx = x + 1j * x[:, np.newaxis] # a + ib over complex plane
>>> out = np.exp(xx)
 >>> plt.subplot(121)
>>> plt.imshow(np.abs(out),
...            extent=[-2*np.pi, 2*np.pi, -2*np.pi, 2*np.pi], cmap='gray')
>>> plt.title('Magnitude of exp(x)')
 >>> plt.subplot(122)
>>> plt.imshow(np.angle(out),
...            extent=[-2*np.pi, 2*np.pi, -2*np.pi, 2*np.pi], cmap='hsv')
>>> plt.title('Phase (angle) of exp(x)')
>>> plt.show()
numpy.exp2   numpy.exp2(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'exp2'>
 
Calculate 2**p for all p in the input array.  Parameters 
 
xarray_like


Input values.  
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


Element-wise 2 to the power x. This is a scalar if x is a scalar.      See also  power
  Notes  New in version 1.3.0.  Examples >>> np.exp2([2, 3])
array([ 4.,  8.])
numpy.expand_dims   numpy.expand_dims(a, axis)[source]
 
Expand the shape of an array. Insert a new axis that will appear at the axis position in the expanded array shape.  Parameters 
 
aarray_like


Input array.  
axisint or tuple of ints


Position in the expanded axes where the new axis (or axes) is placed.  Deprecated since version 1.13.0: Passing an axis where axis > a.ndim will be treated as axis == a.ndim, and passing axis < -a.ndim - 1 will be treated as axis == 0. This behavior is deprecated.   Changed in version 1.18.0: A tuple of axes is now supported. Out of range axes as described above are now forbidden and raise an AxisError.     Returns 
 
resultndarray


View of a with the number of dimensions increased.      See also  squeeze

The inverse operation, removing singleton dimensions  reshape

Insert, remove, and combine dimensions, and resize existing ones  
doc.indexing, atleast_1d, atleast_2d, atleast_3d

  Examples >>> x = np.array([1, 2])
>>> x.shape
(2,)
 The following is equivalent to x[np.newaxis, :] or x[np.newaxis]: >>> y = np.expand_dims(x, axis=0)
>>> y
array([[1, 2]])
>>> y.shape
(1, 2)
 The following is equivalent to x[:, np.newaxis]: >>> y = np.expand_dims(x, axis=1)
>>> y
array([[1],
       [2]])
>>> y.shape
(2, 1)
 axis may also be a tuple: >>> y = np.expand_dims(x, axis=(0, 1))
>>> y
array([[[1, 2]]])
 >>> y = np.expand_dims(x, axis=(2, 0))
>>> y
array([[[1],
        [2]]])
 Note that some examples may use None instead of np.newaxis. These are the same objects: >>> np.newaxis is None
True
numpy.expm1   numpy.expm1(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'expm1'>
 
Calculate exp(x) - 1 for all elements in the array.  Parameters 
 
xarray_like


Input values.  
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


Element-wise exponential minus one: out = exp(x) - 1. This is a scalar if x is a scalar.      See also  log1p

log(1 + x), the inverse of expm1.    Notes This function provides greater precision than exp(x) - 1 for small values of x. Examples The true value of exp(1e-10) - 1 is 1.00000000005e-10 to about 32 significant digits. This example shows the superiority of expm1 in this case. >>> np.expm1(1e-10)
1.00000000005e-10
>>> np.exp(1e-10) - 1
1.000000082740371e-10
numpy.extract   numpy.extract(condition, arr)[source]
 
Return the elements of an array that satisfy some condition. This is equivalent to np.compress(ravel(condition), ravel(arr)). If condition is boolean np.extract is equivalent to arr[condition]. Note that place does the exact opposite of extract.  Parameters 
 
conditionarray_like


An array whose nonzero or True entries indicate the elements of arr to extract.  
arrarray_like


Input array of the same size as condition.    Returns 
 
extractndarray


Rank 1 array of values from arr where condition is True.      See also  
take, put, copyto, compress, place

  Examples >>> arr = np.arange(12).reshape((3, 4))
>>> arr
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11]])
>>> condition = np.mod(arr, 3)==0
>>> condition
array([[ True, False, False,  True],
       [False, False,  True, False],
       [False,  True, False, False]])
>>> np.extract(condition, arr)
array([0, 3, 6, 9])
 If condition is boolean: >>> arr[condition]
array([0, 3, 6, 9])
numpy.eye   numpy.eye(N, M=None, k=0, dtype=<class 'float'>, order='C', *, like=None)[source]
 
Return a 2-D array with ones on the diagonal and zeros elsewhere.  Parameters 
 
Nint


Number of rows in the output.  
Mint, optional


Number of columns in the output. If None, defaults to N.  
kint, optional


Index of the diagonal: 0 (the default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.  
dtypedata-type, optional


Data-type of the returned array.  
order{‘C’, ‘F’}, optional


Whether the output should be stored in row-major (C-style) or column-major (Fortran-style) order in memory.  New in version 1.14.0.   
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 
 
Indarray of shape (N,M)


An array where all elements are equal to zero, except for the k-th diagonal, whose values are equal to one.      See also  identity

(almost) equivalent function  diag

diagonal 2-D array from a 1-D array specified by the user.    Examples >>> np.eye(2, dtype=int)
array([[1, 0],
       [0, 1]])
>>> np.eye(3, k=1)
array([[0.,  1.,  0.],
       [0.,  0.,  1.],
       [0.,  0.,  0.]])
numpy.f2py.get_include()[source]
 
Return the directory that contains the fortranobject.c and .h files.  Note This function is not needed when building an extension with numpy.distutils directly from .f and/or .pyf files in one go.  Python extension modules built with f2py-generated code need to use fortranobject.c as a source file, and include the fortranobject.h header. This function can be used to obtain the directory containing both of these files.  Returns 
 
include_pathstr


Absolute path to the directory containing fortranobject.c and fortranobject.h.      See also  numpy.get_include

function that returns the numpy include directory    Notes  New in version 1.22.0.  Unless the build system you are using has specific support for f2py, building a Python extension using a .pyf signature file is a two-step process. For a module mymod:  Step 1: run python -m numpy.f2py mymod.pyf --quiet. This generates _mymodmodule.c and (if needed) _fblas-f2pywrappers.f files next to mymod.pyf. 
Step 2: build your Python extension module. This requires the following source files:  _mymodmodule.c 
_mymod-f2pywrappers.f (if it was generated in step 1) fortranobject.c
numpy.f2py.run_main(comline_list)[source]
 
Equivalent to running: f2py <args>
 where <args>=string.join(<list>,' '), but in Python. Unless -h is used, this function returns a dictionary containing information on generated modules and their dependencies on source files. For example, the command f2py -m scalar scalar.f can be executed from Python as follows You cannot build extension modules with this function, that is, using -c is not allowed. Use compile command instead Examples >>> import numpy.f2py
>>> r = numpy.f2py.run_main(['-m','scalar','doc/source/f2py/scalar.f'])
Reading fortran codes...
        Reading file 'doc/source/f2py/scalar.f' (format:fix,strict)
Post-processing...
        Block: scalar
                        Block: FOO
Building modules...
        Building module "scalar"...
        Wrote C/API module "scalar" to file "./scalarmodule.c"
>>> print(r)
{'scalar': {'h': ['/home/users/pearu/src_cvs/f2py/src/fortranobject.h'],
	 'csrc': ['./scalarmodule.c', 
                  '/home/users/pearu/src_cvs/f2py/src/fortranobject.c']}}
numpy.fabs   numpy.fabs(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'fabs'>
 
Compute the absolute values element-wise. This function returns the absolute values (positive magnitude) of the data in x. Complex values are not handled, use absolute to find the absolute values of complex data.  Parameters 
 
xarray_like


The array of numbers for which the absolute values are required. If x is a scalar, the result y will also be a scalar.  
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 absolute values of x, the returned values are always floats. This is a scalar if x is a scalar.      See also  absolute

Absolute values including complex types.    Examples >>> np.fabs(-1)
1.0
>>> np.fabs([-1.2, 1.2])
array([ 1.2,  1.2])
numpy.fill_diagonal   numpy.fill_diagonal(a, val, wrap=False)[source]
 
Fill the main diagonal of the given array of any dimensionality. For an array a with a.ndim >= 2, the diagonal is the list of locations with indices a[i, ..., i] all identical. This function modifies the input array in-place, it does not return a value.  Parameters 
 
aarray, at least 2-D.


Array whose diagonal is to be filled, it gets modified in-place.  
valscalar or array_like


Value(s) to write on the diagonal. If val is scalar, the value is written along the diagonal. If array-like, the flattened val is written along the diagonal, repeating if necessary to fill all diagonal entries.  
wrapbool


For tall matrices in NumPy version up to 1.6.2, the diagonal “wrapped” after N columns. You can have this behavior with this option. This affects only tall matrices.      See also  
diag_indices, diag_indices_from

  Notes  New in version 1.4.0.  This functionality can be obtained via diag_indices, but internally this version uses a much faster implementation that never constructs the indices and uses simple slicing. Examples >>> a = np.zeros((3, 3), int)
>>> np.fill_diagonal(a, 5)
>>> a
array([[5, 0, 0],
       [0, 5, 0],
       [0, 0, 5]])
 The same function can operate on a 4-D array: >>> a = np.zeros((3, 3, 3, 3), int)
>>> np.fill_diagonal(a, 4)
 We only show a few blocks for clarity: >>> a[0, 0]
array([[4, 0, 0],
       [0, 0, 0],
       [0, 0, 0]])
>>> a[1, 1]
array([[0, 0, 0],
       [0, 4, 0],
       [0, 0, 0]])
>>> a[2, 2]
array([[0, 0, 0],
       [0, 0, 0],
       [0, 0, 4]])
 The wrap option affects only tall matrices: >>> # tall matrices no wrap
>>> a = np.zeros((5, 3), int)
>>> np.fill_diagonal(a, 4)
>>> a
array([[4, 0, 0],
       [0, 4, 0],
       [0, 0, 4],
       [0, 0, 0],
       [0, 0, 0]])
 >>> # tall matrices wrap
>>> a = np.zeros((5, 3), int)
>>> np.fill_diagonal(a, 4, wrap=True)
>>> a
array([[4, 0, 0],
       [0, 4, 0],
       [0, 0, 4],
       [0, 0, 0],
       [4, 0, 0]])
 >>> # wide matrices
>>> a = np.zeros((3, 5), int)
>>> np.fill_diagonal(a, 4, wrap=True)
>>> a
array([[4, 0, 0, 0, 0],
       [0, 4, 0, 0, 0],
       [0, 0, 4, 0, 0]])
 The anti-diagonal can be filled by reversing the order of elements using either numpy.flipud or numpy.fliplr. >>> a = np.zeros((3, 3), int);
>>> np.fill_diagonal(np.fliplr(a), [1,2,3])  # Horizontal flip
>>> a
array([[0, 0, 1],
       [0, 2, 0],
       [3, 0, 0]])
>>> np.fill_diagonal(np.flipud(a), [1,2,3])  # Vertical flip
>>> a
array([[0, 0, 3],
       [0, 2, 0],
       [1, 0, 0]])
 Note that the order in which the diagonal is filled varies depending on the flip function.
numpy.find_common_type   numpy.find_common_type(array_types, scalar_types)[source]
 
Determine common type following standard coercion rules.  Parameters 
 
array_typessequence


A list of dtypes or dtype convertible objects representing arrays.  
scalar_typessequence


A list of dtypes or dtype convertible objects representing scalars.    Returns 
 
datatypedtype


The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.      See also  
dtype, common_type, can_cast, mintypecode

  Examples >>> np.find_common_type([], [np.int64, np.float32, complex])
dtype('complex128')
>>> np.find_common_type([np.int64, np.float32], [])
dtype('float64')
 The standard casting rules ensure that a scalar cannot up-cast an array unless the scalar is of a fundamentally different kind of data (i.e. under a different hierarchy in the data type hierarchy) then the array: >>> np.find_common_type([np.float32], [np.int64, np.float64])
dtype('float32')
 Complex is of a different type, so it up-casts the float in the array_types argument: >>> np.find_common_type([np.float32], [complex])
dtype('complex128')
 Type specifier strings are convertible to dtypes and can therefore be used instead of dtypes: >>> np.find_common_type(['f4', 'f4', 'i4'], ['c8'])
dtype('complex128')
numpy.finfo   class numpy.finfo(dtype)[source]
 
Machine limits for floating point types.  Parameters 
 
dtypefloat, dtype, or instance


Kind of floating point data-type about which to get information.      See also  MachAr

The implementation of the tests that produce this information.  iinfo

The equivalent for integer data types.  spacing

The distance between a value and the nearest adjacent number  nextafter

The next floating point value after x1 towards x2    Notes For developers of NumPy: do not instantiate this at the module level. The initial calculation of these parameters is expensive and negatively impacts import times. These objects are cached, so calling finfo() repeatedly inside your functions is not a problem. Note that smallest_normal is not actually the smallest positive representable value in a NumPy floating point type. As in the IEEE-754 standard [1], NumPy floating point types make use of subnormal numbers to fill the gap between 0 and smallest_normal. However, subnormal numbers may have significantly reduced precision [2]. References  1 
IEEE Standard for Floating-Point Arithmetic, IEEE Std 754-2008, pp.1-70, 2008, http://www.doi.org/10.1109/IEEESTD.2008.4610935  2 
Wikipedia, “Denormal Numbers”, https://en.wikipedia.org/wiki/Denormal_number    Attributes 
 
bitsint


The number of bits occupied by the type.  
epsfloat


The difference between 1.0 and the next smallest representable float larger than 1.0. For example, for 64-bit binary floats in the IEEE-754 standard, eps = 2**-52, approximately 2.22e-16.  
epsnegfloat


The difference between 1.0 and the next smallest representable float less than 1.0. For example, for 64-bit binary floats in the IEEE-754 standard, epsneg = 2**-53, approximately 1.11e-16.  
iexpint


The number of bits in the exponent portion of the floating point representation.  
macharMachAr


The object which calculated these parameters and holds more detailed information.  
machepint


The exponent that yields eps.  
maxfloating point number of the appropriate type


The largest representable number.  
maxexpint


The smallest positive power of the base (2) that causes overflow.  
minfloating point number of the appropriate type


The smallest representable number, typically -max.  
minexpint


The most negative power of the base (2) consistent with there being no leading 0’s in the mantissa.  
negepint


The exponent that yields epsneg.  
nexpint


The number of bits in the exponent including its sign and bias.  
nmantint


The number of bits in the mantissa.  
precisionint


The approximate number of decimal digits to which this kind of float is precise.  
resolutionfloating point number of the appropriate type


The approximate decimal resolution of this type, i.e., 10**-precision.  
tinyfloat


Return the value for tiny, alias of smallest_normal.  
smallest_normalfloat


Return the value for the smallest normal.  
smallest_subnormalfloat


The smallest positive floating point number with 0 as leading bit in the mantissa following IEEE-754.
numpy.fix   numpy.fix(x, out=None)[source]
 
Round to nearest integer towards zero. Round an array of floats element-wise to nearest integer towards zero. The rounded values are returned as floats.  Parameters 
 
xarray_like


An array of floats to be rounded  
outndarray, optional


A location into which the result is stored. If provided, it must have a shape that the input broadcasts to. If not provided or None, a freshly-allocated array is returned.    Returns 
 
outndarray of floats


A float array with the same dimensions as the input. If second argument is not supplied then a float array is returned with the rounded values. If a second argument is supplied the result is stored there. The return value out is then a reference to that array.      See also  
rint, trunc, floor, ceil

around

Round to given number of decimals    Examples >>> np.fix(3.14)
3.0
>>> np.fix(3)
3.0
>>> np.fix([2.1, 2.9, -2.1, -2.9])
array([ 2.,  2., -2., -2.])
numpy.flatiter   class numpy.flatiter[source]
 
Flat iterator object to iterate over arrays. A flatiter iterator is returned by x.flat for any array x. It allows iterating over the array as if it were a 1-D array, either in a for-loop or by calling its next method. Iteration is done in row-major, C-style order (the last index varying the fastest). The iterator can also be indexed using basic slicing or advanced indexing.  See also  ndarray.flat

Return a flat iterator over an array.  ndarray.flatten

Returns a flattened copy of an array.    Notes A flatiter iterator can not be constructed directly from Python code by calling the flatiter constructor. Examples >>> x = np.arange(6).reshape(2, 3)
>>> fl = x.flat
>>> type(fl)
<class 'numpy.flatiter'>
>>> for item in fl:
...     print(item)
...
0
1
2
3
4
5
 >>> fl[2:4]
array([2, 3])
  Attributes 
 base

A reference to the array that is iterated over.  coords

An N-dimensional tuple of current coordinates.  index

Current flat index into the array.     Methods  
copy() Get a copy of the iterator as a 1-D array.
numpy.flatnonzero   numpy.flatnonzero(a)[source]
 
Return indices that are non-zero in the flattened version of a. This is equivalent to np.nonzero(np.ravel(a))[0].  Parameters 
 
aarray_like


Input data.    Returns 
 
resndarray


Output array, containing the indices of the elements of a.ravel() that are non-zero.      See also  nonzero

Return the indices of the non-zero elements of the input array.  ravel

Return a 1-D array containing the elements of the input array.    Examples >>> x = np.arange(-2, 3)
>>> x
array([-2, -1,  0,  1,  2])
>>> np.flatnonzero(x)
array([0, 1, 3, 4])
 Use the indices of the non-zero elements as an index array to extract these elements: >>> x.ravel()[np.flatnonzero(x)]
array([-2, -1,  1,  2])
class numpy.flexible[source]
 
Abstract base class of all scalar types without predefined length. The actual size of these types depends on the specific np.dtype instantiation.