neulab/docprompting-conala huggingface dataset:
numpy.sin   numpy.sin(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'sin'>
 
Trigonometric sine, element-wise.  Parameters 
 
xarray_like


Angle, in radians (\(2 \pi\) rad equals 360 degrees).  
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 
 
yarray_like


The sine of each element of x. This is a scalar if x is a scalar.      See also  
arcsin, sinh, cos

  Notes The sine is one of the fundamental functions of trigonometry (the mathematical study of triangles). Consider a circle of radius 1 centered on the origin. A ray comes in from the \(+x\) axis, makes an angle at the origin (measured counter-clockwise from that axis), and departs from the origin. The \(y\) coordinate of the outgoing ray’s intersection with the unit circle is the sine of that angle. It ranges from -1 for \(x=3\pi / 2\) to +1 for \(\pi / 2.\) The function has zeroes where the angle is a multiple of \(\pi\). Sines of angles between \(\pi\) and \(2\pi\) are negative. The numerous properties of the sine and related functions are included in any standard trigonometry text. Examples Print sine of one angle: >>> np.sin(np.pi/2.)
1.0
 Print sines of an array of angles given in degrees: >>> np.sin(np.array((0., 30., 45., 60., 90.)) * np.pi / 180. )
array([ 0.        ,  0.5       ,  0.70710678,  0.8660254 ,  1.        ])
 Plot the sine function: >>> import matplotlib.pylab as plt
>>> x = np.linspace(-np.pi, np.pi, 201)
>>> plt.plot(x, np.sin(x))
>>> plt.xlabel('Angle [rad]')
>>> plt.ylabel('sin(x)')
>>> plt.axis('tight')
>>> plt.show()
numpy.sinc   numpy.sinc(x)[source]
 
Return the normalized sinc function. The sinc function is \(\sin(\pi x)/(\pi x)\).  Note Note the normalization factor of pi used in the definition. This is the most commonly used definition in signal processing. Use sinc(x / np.pi) to obtain the unnormalized sinc function \(\sin(x)/(x)\) that is more common in mathematics.   Parameters 
 
xndarray


Array (possibly multi-dimensional) of values for which to to calculate sinc(x).    Returns 
 
outndarray


sinc(x), which has the same shape as the input.     Notes sinc(0) is the limit value 1. The name sinc is short for “sine cardinal” or “sinus cardinalis”. The sinc function is used in various signal processing applications, including in anti-aliasing, in the construction of a Lanczos resampling filter, and in interpolation. For bandlimited interpolation of discrete-time signals, the ideal interpolation kernel is proportional to the sinc function. References  1 
Weisstein, Eric W. “Sinc Function.” From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/SincFunction.html  2 
Wikipedia, “Sinc function”, https://en.wikipedia.org/wiki/Sinc_function   Examples >>> import matplotlib.pyplot as plt
>>> x = np.linspace(-4, 4, 41)
>>> np.sinc(x)
 array([-3.89804309e-17,  -4.92362781e-02,  -8.40918587e-02, # may vary
        -8.90384387e-02,  -5.84680802e-02,   3.89804309e-17,
        6.68206631e-02,   1.16434881e-01,   1.26137788e-01,
        8.50444803e-02,  -3.89804309e-17,  -1.03943254e-01,
        -1.89206682e-01,  -2.16236208e-01,  -1.55914881e-01,
        3.89804309e-17,   2.33872321e-01,   5.04551152e-01,
        7.56826729e-01,   9.35489284e-01,   1.00000000e+00,
        9.35489284e-01,   7.56826729e-01,   5.04551152e-01,
        2.33872321e-01,   3.89804309e-17,  -1.55914881e-01,
       -2.16236208e-01,  -1.89206682e-01,  -1.03943254e-01,
       -3.89804309e-17,   8.50444803e-02,   1.26137788e-01,
        1.16434881e-01,   6.68206631e-02,   3.89804309e-17,
        -5.84680802e-02,  -8.90384387e-02,  -8.40918587e-02,
        -4.92362781e-02,  -3.89804309e-17])
 >>> plt.plot(x, np.sinc(x))
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.title("Sinc Function")
Text(0.5, 1.0, 'Sinc Function')
>>> plt.ylabel("Amplitude")
Text(0, 0.5, 'Amplitude')
>>> plt.xlabel("X")
Text(0.5, 0, 'X')
>>> plt.show()
class numpy.single[source]
 
Single-precision floating-point number type, compatible with C float.  Character code 
'f'  Alias on this platform (Linux x86_64) 
numpy.float32: 32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa.
numpy.sinh   numpy.sinh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'sinh'>
 
Hyperbolic sine, element-wise. Equivalent to 1/2 * (np.exp(x) - np.exp(-x)) or -1j * np.sin(1j*x).  Parameters 
 
xarray_like


Input array.  
outndarray, None, or tuple of ndarray and None, optional


A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.  
wherearray_like, optional


This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.  **kwargs

For other keyword-only arguments, see the ufunc docs.    Returns 
 
yndarray


The corresponding hyperbolic sine values. This is a scalar if x is a scalar.     Notes If out is provided, the function writes the result into it, and returns a reference to out. (See Examples) References M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions. New York, NY: Dover, 1972, pg. 83. Examples >>> np.sinh(0)
0.0
>>> np.sinh(np.pi*1j/2)
1j
>>> np.sinh(np.pi*1j) # (exact value is 0)
1.2246063538223773e-016j
>>> # Discrepancy due to vagaries of floating point arithmetic.
 >>> # Example of providing the optional output parameter
>>> out1 = np.array([0], dtype='d')
>>> out2 = np.sinh([0.1], out1)
>>> out2 is out1
True
 >>> # Example of ValueError due to provision of shape mis-matched `out`
>>> np.sinh(np.zeros((3,3)),np.zeros((2,2)))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: operands could not be broadcast together with shapes (3,3) (2,2)
numpy.sort_complex   numpy.sort_complex(a)[source]
 
Sort a complex array using the real part first, then the imaginary part.  Parameters 
 
aarray_like


Input array    Returns 
 
outcomplex ndarray


Always returns a sorted complex array.     Examples >>> np.sort_complex([5, 3, 6, 2, 1])
array([1.+0.j, 2.+0.j, 3.+0.j, 5.+0.j, 6.+0.j])
 >>> np.sort_complex([1 + 2j, 2 - 1j, 3 - 2j, 3 - 3j, 3 + 5j])
array([1.+2.j,  2.-1.j,  3.-3.j,  3.-2.j,  3.+5.j])
numpy.source   numpy.source(object, output=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
 
Print or write to a file the source code for a NumPy object. The source code is only returned for objects written in Python. Many functions and classes are defined in C and will therefore not return useful information.  Parameters 
 
objectnumpy object


Input object. This can be any object (function, class, module, …).  
outputfile object, optional


If output not supplied then source code is printed to screen (sys.stdout). File object must be created with either write ‘w’ or append ‘a’ modes.      See also  
lookfor, info

  Examples >>> np.source(np.interp)                        
In file: /usr/lib/python2.6/dist-packages/numpy/lib/function_base.py
def interp(x, xp, fp, left=None, right=None):
    """.... (full docstring printed)"""
    if isinstance(x, (float, int, number)):
        return compiled_interp([x], xp, fp, left, right).item()
    else:
        return compiled_interp(x, xp, fp, left, right)
 The source code is only returned for objects written in Python. >>> np.source(np.array)                         
Not available for this object.
numpy.spacing   numpy.spacing(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'spacing'>
 
Return the distance between x and the nearest adjacent number.  Parameters 
 
xarray_like


Values to find the spacing of.  
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 spacing of values of x. This is a scalar if x is a scalar.     Notes It can be considered as a generalization of EPS: spacing(np.float64(1)) == np.finfo(np.float64).eps, and there should not be any representable number between x + spacing(x) and x for any finite x. Spacing of +- inf and NaN is NaN. Examples >>> np.spacing(1) == np.finfo(np.float64).eps
True
numpy.split   numpy.split(ary, indices_or_sections, axis=0)[source]
 
Split an array into multiple sub-arrays as views into ary.  Parameters 
 
aryndarray


Array to be divided into sub-arrays.  
indices_or_sectionsint or 1-D array


If indices_or_sections is an integer, N, the array will be divided into N equal arrays along axis. If such a split is not possible, an error is raised. If indices_or_sections is a 1-D array of sorted integers, the entries indicate where along axis the array is split. For example, [2, 3] would, for axis=0, result in  ary[:2] ary[2:3] ary[3:]  If an index exceeds the dimension of the array along axis, an empty sub-array is returned correspondingly.  
axisint, optional


The axis along which to split, default is 0.    Returns 
 
sub-arrayslist of ndarrays


A list of sub-arrays as views into ary.    Raises 
 ValueError

If indices_or_sections is given as an integer, but a split does not result in equal division.      See also  array_split

Split an array into multiple sub-arrays of equal or near-equal size. Does not raise an exception if an equal division cannot be made.  hsplit

Split array into multiple sub-arrays horizontally (column-wise).  vsplit

Split array into multiple sub-arrays vertically (row wise).  dsplit

Split array into multiple sub-arrays along the 3rd axis (depth).  concatenate

Join a sequence of arrays along an existing axis.  stack

Join a sequence of arrays along a new axis.  hstack

Stack arrays in sequence horizontally (column wise).  vstack

Stack arrays in sequence vertically (row wise).  dstack

Stack arrays in sequence depth wise (along third dimension).    Examples >>> x = np.arange(9.0)
>>> np.split(x, 3)
[array([0.,  1.,  2.]), array([3.,  4.,  5.]), array([6.,  7.,  8.])]
 >>> x = np.arange(8.0)
>>> np.split(x, [3, 5, 6, 10])
[array([0.,  1.,  2.]),
 array([3.,  4.]),
 array([5.]),
 array([6.,  7.]),
 array([], dtype=float64)]
numpy.sqrt   numpy.sqrt(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'sqrt'>
 
Return the non-negative square-root of an array, element-wise.  Parameters 
 
xarray_like


The values whose square-roots are required.  
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


An array of the same shape as x, containing the positive square-root of each element in x. If any element in x is complex, a complex array is returned (and the square-roots of negative reals are calculated). If all of the elements in x are real, so is y, with negative elements returning nan. If out was provided, y is a reference to it. This is a scalar if x is a scalar.      See also  lib.scimath.sqrt

A version which returns complex numbers when given negative reals.    Notes sqrt has–consistent with common convention–as its branch cut the real “interval” [-inf, 0), and is continuous from above on it. A branch cut is a curve in the complex plane across which a given complex function fails to be continuous. Examples >>> np.sqrt([1,4,9])
array([ 1.,  2.,  3.])
 >>> np.sqrt([4, -1, -3+4J])
array([ 2.+0.j,  0.+1.j,  1.+2.j])
 >>> np.sqrt([4, -1, np.inf])
array([ 2., nan, inf])
numpy.square   numpy.square(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'square'>
 
Return the element-wise square of the input.  Parameters 
 
xarray_like


Input data.  
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 x*x, of the same shape and dtype as x. This is a scalar if x is a scalar.      See also  numpy.linalg.matrix_power
sqrt
power
  Examples >>> np.square([-1j, 1])
array([-1.-0.j,  1.+0.j])
numpy.squeeze   numpy.squeeze(a, axis=None)[source]
 
Remove axes of length one from a.  Parameters 
 
aarray_like


Input data.  
axisNone or int or tuple of ints, optional


 New in version 1.7.0.  Selects a subset of the entries of length one in the shape. If an axis is selected with shape entry greater than one, an error is raised.    Returns 
 
squeezedndarray


The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a. Note that if all axes are squeezed, the result is a 0d array and not a scalar.    Raises 
 ValueError

If axis is not None, and an axis being squeezed is not of length 1      See also  expand_dims

The inverse operation, adding entries of length one  reshape

Insert, remove, and combine dimensions, and resize existing ones    Examples >>> x = np.array([[[0], [1], [2]]])
>>> x.shape
(1, 3, 1)
>>> np.squeeze(x).shape
(3,)
>>> np.squeeze(x, axis=0).shape
(3, 1)
>>> np.squeeze(x, axis=1).shape
Traceback (most recent call last):
...
ValueError: cannot select an axis to squeeze out which has size not equal to one
>>> np.squeeze(x, axis=2).shape
(1, 3)
>>> x = np.array([[1234]])
>>> x.shape
(1, 1)
>>> np.squeeze(x)
array(1234)  # 0d array
>>> np.squeeze(x).shape
()
>>> np.squeeze(x)[()]
1234
numpy.stack   numpy.stack(arrays, axis=0, out=None)[source]
 
Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.  New in version 1.10.0.   Parameters 
 
arrayssequence of array_like


Each array must have the same shape.  
axisint, optional


The axis in the result array along which the input arrays are stacked.  
outndarray, optional


If provided, the destination to place the result. The shape must be correct, matching that of what stack would have returned if no out argument were specified.    Returns 
 
stackedndarray


The stacked array has one more dimension than the input arrays.      See also  concatenate

Join a sequence of arrays along an existing axis.  block

Assemble an nd-array from nested lists of blocks.  split

Split array into a list of multiple sub-arrays of equal size.    Examples >>> arrays = [np.random.randn(3, 4) for _ in range(10)]
>>> np.stack(arrays, axis=0).shape
(10, 3, 4)
 >>> np.stack(arrays, axis=1).shape
(3, 10, 4)
 >>> np.stack(arrays, axis=2).shape
(3, 4, 10)
 >>> a = np.array([1, 2, 3])
>>> b = np.array([4, 5, 6])
>>> np.stack((a, b))
array([[1, 2, 3],
       [4, 5, 6]])
 >>> np.stack((a, b), axis=-1)
array([[1, 4],
       [2, 5],
       [3, 6]])
class numpy.str_[source]
 
A unicode string. When used in arrays, this type strips trailing null codepoints. Unlike the builtin str, this supports the Buffer Protocol, exposing its contents as UCS4: >>> m = memoryview(np.str_("abc"))
>>> m.format
'3w'
>>> m.tobytes()
b'a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00'
  Character code 
'U'  Alias 
numpy.unicode_
numpy.subtract   numpy.subtract(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'subtract'>
 
Subtract arguments, element-wise.  Parameters 
 
x1, x2array_like


The arrays to be subtracted from each other. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).  
outndarray, None, or tuple of ndarray and None, optional


A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.  
wherearray_like, optional


This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.  **kwargs

For other keyword-only arguments, see the ufunc docs.    Returns 
 
yndarray


The difference of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.     Notes Equivalent to x1 - x2 in terms of array broadcasting. Examples >>> np.subtract(1.0, 4.0)
-3.0
 >>> x1 = np.arange(9.0).reshape((3, 3))
>>> x2 = np.arange(3.0)
>>> np.subtract(x1, x2)
array([[ 0.,  0.,  0.],
       [ 3.,  3.,  3.],
       [ 6.,  6.,  6.]])
 The - operator can be used as a shorthand for np.subtract on ndarrays. >>> x1 = np.arange(9.0).reshape((3, 3))
>>> x2 = np.arange(3.0)
>>> x1 - x2
array([[0., 0., 0.],
       [3., 3., 3.],
       [6., 6., 6.]])
numpy.swapaxes   numpy.swapaxes(a, axis1, axis2)[source]
 
Interchange two axes of an array.  Parameters 
 
aarray_like


Input array.  
axis1int


First axis.  
axis2int


Second axis.    Returns 
 
a_swappedndarray


For NumPy >= 1.10.0, if a is an ndarray, then a view of a is returned; otherwise a new array is created. For earlier NumPy versions a view of a is returned only if the order of the axes is changed, otherwise the input array is returned.     Examples >>> x = np.array([[1,2,3]])
>>> np.swapaxes(x,0,1)
array([[1],
       [2],
       [3]])
 >>> x = np.array([[[0,1],[2,3]],[[4,5],[6,7]]])
>>> x
array([[[0, 1],
        [2, 3]],
       [[4, 5],
        [6, 7]]])
 >>> np.swapaxes(x,0,2)
array([[[0, 4],
        [2, 6]],
       [[1, 5],
        [3, 7]]])
numpy.take   numpy.take(a, indices, axis=None, out=None, mode='raise')[source]
 
Take elements from an array along an axis. When axis is not None, this function does the same thing as “fancy” indexing (indexing arrays using arrays); however, it can be easier to use if you need elements along a given axis. A call such as np.take(arr, indices, axis=3) is equivalent to arr[:,:,:,indices,...]. Explained without fancy indexing, this is equivalent to the following use of ndindex, which sets each of ii, jj, and kk to a tuple of indices: Ni, Nk = a.shape[:axis], a.shape[axis+1:]
Nj = indices.shape
for ii in ndindex(Ni):
    for jj in ndindex(Nj):
        for kk in ndindex(Nk):
            out[ii + jj + kk] = a[ii + (indices[jj],) + kk]
  Parameters 
 
aarray_like (Ni…, M, Nk…)


The source array.  
indicesarray_like (Nj…)


The indices of the values to extract.  New in version 1.8.0.  Also allow scalars for indices.  
axisint, optional


The axis over which to select values. By default, the flattened input array is used.  
outndarray, optional (Ni…, Nj…, Nk…)


If provided, the result will be placed in this array. It should be of the appropriate shape and dtype. Note that out is always buffered if mode=’raise’; use other modes for better performance.  
mode{‘raise’, ‘wrap’, ‘clip’}, optional


Specifies how out-of-bounds indices will behave.  ‘raise’ – raise an error (default) ‘wrap’ – wrap around ‘clip’ – clip to the range  ‘clip’ mode means that all indices that are too large are replaced by the index that addresses the last element along that axis. Note that this disables indexing with negative numbers.    Returns 
 
outndarray (Ni…, Nj…, Nk…)


The returned array has the same type as a.      See also  compress

Take elements using a boolean mask  ndarray.take

equivalent method  take_along_axis

Take elements by matching the array and the index arrays    Notes By eliminating the inner loop in the description above, and using s_ to build simple slice objects, take can be expressed in terms of applying fancy indexing to each 1-d slice: Ni, Nk = a.shape[:axis], a.shape[axis+1:]
for ii in ndindex(Ni):
    for kk in ndindex(Nj):
        out[ii + s_[...,] + kk] = a[ii + s_[:,] + kk][indices]
 For this reason, it is equivalent to (but faster than) the following use of apply_along_axis: out = np.apply_along_axis(lambda a_1d: a_1d[indices], axis, a)
 Examples >>> a = [4, 3, 5, 7, 6, 8]
>>> indices = [0, 1, 4]
>>> np.take(a, indices)
array([4, 3, 6])
 In this example if a is an ndarray, “fancy” indexing can be used. >>> a = np.array(a)
>>> a[indices]
array([4, 3, 6])
 If indices is not one dimensional, the output also has these dimensions. >>> np.take(a, [[0, 1], [2, 3]])
array([[4, 3],
       [5, 7]])