neulab/docprompting-conala huggingface dataset:
numpy.broadcast_to   numpy.broadcast_to(array, shape, subok=False)[source]
 
Broadcast an array to a new shape.  Parameters 
 
arrayarray_like


The array to broadcast.  
shapetuple or int


The shape of the desired array. A single integer i is interpreted as (i,).  
subokbool, optional


If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).    Returns 
 
broadcastarray


A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.    Raises 
 ValueError

If the array is not compatible with the new shape according to NumPy’s broadcasting rules.      See also  broadcast
broadcast_arrays
broadcast_shapes
  Notes  New in version 1.10.0.  Examples >>> x = np.array([1, 2, 3])
>>> np.broadcast_to(x, (3, 3))
array([[1, 2, 3],
       [1, 2, 3],
       [1, 2, 3]])
numpy.busday_count   numpy.busday_count(begindates, enddates, weekmask='1111100', holidays=[], busdaycal=None, out=None)
 
Counts the number of valid days between begindates and enddates, not including the day of enddates. If enddates specifies a date value that is earlier than the corresponding begindates date value, the count will be negative.  New in version 1.7.0.   Parameters 
 
begindatesarray_like of datetime64[D]


The array of the first dates for counting.  
enddatesarray_like of datetime64[D]


The array of the end dates for counting, which are excluded from the count themselves.  
weekmaskstr or array_like of bool, optional


A seven-element array indicating which of Monday through Sunday are valid days. May be specified as a length-seven list or array, like [1,1,1,1,1,0,0]; a length-seven string, like ‘1111100’; or a string like “Mon Tue Wed Thu Fri”, made up of 3-character abbreviations for weekdays, optionally separated by white space. Valid abbreviations are: Mon Tue Wed Thu Fri Sat Sun  
holidaysarray_like of datetime64[D], optional


An array of dates to consider as invalid dates. They may be specified in any order, and NaT (not-a-time) dates are ignored. This list is saved in a normalized form that is suited for fast calculations of valid days.  
busdaycalbusdaycalendar, optional


A busdaycalendar object which specifies the valid days. If this parameter is provided, neither weekmask nor holidays may be provided.  
outarray of int, optional


If provided, this array is filled with the result.    Returns 
 
outarray of int


An array with a shape from broadcasting begindates and enddates together, containing the number of valid days between the begin and end dates.      See also  busdaycalendar

An object that specifies a custom set of valid days.  is_busday

Returns a boolean array indicating valid days.  busday_offset

Applies an offset counted in valid days.    Examples >>> # Number of weekdays in January 2011
... np.busday_count('2011-01', '2011-02')
21
>>> # Number of weekdays in 2011
>>> np.busday_count('2011', '2012')
260
>>> # Number of Saturdays in 2011
... np.busday_count('2011', '2012', weekmask='Sat')
53
numpy.busdaycalendar   class numpy.busdaycalendar(weekmask='1111100', holidays=None)[source]
 
A business day calendar object that efficiently stores information defining valid days for the busday family of functions. The default valid days are Monday through Friday (“business days”). A busdaycalendar object can be specified with any set of weekly valid days, plus an optional “holiday” dates that always will be invalid. Once a busdaycalendar object is created, the weekmask and holidays cannot be modified.  New in version 1.7.0.   Parameters 
 
weekmaskstr or array_like of bool, optional


A seven-element array indicating which of Monday through Sunday are valid days. May be specified as a length-seven list or array, like [1,1,1,1,1,0,0]; a length-seven string, like ‘1111100’; or a string like “Mon Tue Wed Thu Fri”, made up of 3-character abbreviations for weekdays, optionally separated by white space. Valid abbreviations are: Mon Tue Wed Thu Fri Sat Sun  
holidaysarray_like of datetime64[D], optional


An array of dates to consider as invalid dates, no matter which weekday they fall upon. Holiday dates may be specified in any order, and NaT (not-a-time) dates are ignored. This list is saved in a normalized form that is suited for fast calculations of valid days.    Returns 
 
outbusdaycalendar


A business day calendar object containing the specified weekmask and holidays values.      See also  is_busday

Returns a boolean array indicating valid days.  busday_offset

Applies an offset counted in valid days.  busday_count

Counts how many valid days are in a half-open date range.    Examples >>> # Some important days in July
... bdd = np.busdaycalendar(
...             holidays=['2011-07-01', '2011-07-04', '2011-07-17'])
>>> # Default is Monday to Friday weekdays
... bdd.weekmask
array([ True,  True,  True,  True,  True, False, False])
>>> # Any holidays already on the weekend are removed
... bdd.holidays
array(['2011-07-01', '2011-07-04'], dtype='datetime64[D]')
  Attributes 
 Note: once a busdaycalendar object is created, you cannot modify the
weekmask or holidays. The attributes return copies of internal data.

weekmask(copy) seven-element array of bool


A copy of the seven-element boolean mask indicating valid days.  
holidays(copy) sorted array of datetime64[D]


A copy of the holiday array indicating additional invalid days.
class numpy.byte[source]
 
Signed integer type, compatible with C char.  Character code 
'b'  Alias on this platform (Linux x86_64) 
numpy.int8: 8-bit signed integer (-128 to 127).
numpy.byte_bounds   numpy.byte_bounds(a)[source]
 
Returns pointers to the end-points of an array.  Parameters 
 
andarray


Input array. It must conform to the Python-side of the array interface.    Returns 
 
(low, high)tuple of 2 integers


The first integer is the first byte of the array, the second integer is just past the last byte of the array. If a is not contiguous it will not use every byte between the (low, high) values.     Examples >>> I = np.eye(2, dtype='f'); I.dtype
dtype('float32')
>>> low, high = np.byte_bounds(I)
>>> high - low == I.size*I.itemsize
True
>>> I = np.eye(2); I.dtype
dtype('float64')
>>> low, high = np.byte_bounds(I)
>>> high - low == I.size*I.itemsize
True
class numpy.bytes_[source]
 
A byte string. When used in arrays, this type strips trailing null bytes.  Character code 
'S'  Alias 
numpy.string_
numpy.c_   numpy.c_ = <numpy.lib.index_tricks.CClass object>
 
Translates slice objects to concatenation along the second axis. This is short-hand for np.r_['-1,2,0', index expression], which is useful because of its common occurrence. In particular, arrays will be stacked along their last axis after being upgraded to at least 2-D with 1’s post-pended to the shape (column vectors made out of 1-D arrays).  See also  column_stack

Stack 1-D arrays as columns into a 2-D array.  r_

For more detailed documentation.    Examples >>> np.c_[np.array([1,2,3]), np.array([4,5,6])]
array([[1, 4],
       [2, 5],
       [3, 6]])
>>> np.c_[np.array([[1,2,3]]), 0, 0, np.array([[4,5,6]])]
array([[1, 2, 3, ..., 4, 5, 6]])
numpy.can_cast   numpy.can_cast(from_, to, casting='safe')
 
Returns True if cast between data types can occur according to the casting rule. If from is a scalar or array scalar, also returns True if the scalar value can be cast without overflow or truncation to an integer.  Parameters 
 
from_dtype, dtype specifier, scalar, or array


Data type, scalar, or array to cast from.  
todtype or dtype specifier


Data type to cast to.  
casting{‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional


Controls what kind of data casting may occur.  ‘no’ means the data types should not be cast at all. ‘equiv’ means only byte-order changes are allowed. ‘safe’ means only casts which can preserve values are allowed. ‘same_kind’ means only safe casts or casts within a kind, like float64 to float32, are allowed. ‘unsafe’ means any data conversions may be done.     Returns 
 
outbool


True if cast can occur according to the casting rule.      See also  
dtype, result_type

  Notes  Changed in version 1.17.0: Casting between a simple data type and a structured one is possible only for “unsafe” casting. Casting to multiple fields is allowed, but casting from multiple fields is not.   Changed in version 1.9.0: Casting from numeric to string types in ‘safe’ casting mode requires that the string dtype length is long enough to store the maximum integer/float value converted.  Examples Basic examples >>> np.can_cast(np.int32, np.int64)
True
>>> np.can_cast(np.float64, complex)
True
>>> np.can_cast(complex, float)
False
 >>> np.can_cast('i8', 'f8')
True
>>> np.can_cast('i8', 'f4')
False
>>> np.can_cast('i4', 'S4')
False
 Casting scalars >>> np.can_cast(100, 'i1')
True
>>> np.can_cast(150, 'i1')
False
>>> np.can_cast(150, 'u1')
True
 >>> np.can_cast(3.5e100, np.float32)
False
>>> np.can_cast(1000.0, np.float32)
True
 Array scalar checks the value, array does not >>> np.can_cast(np.array(1000.0), np.float32)
True
>>> np.can_cast(np.array([1000.0]), np.float32)
False
 Using the casting rules >>> np.can_cast('i8', 'i8', 'no')
True
>>> np.can_cast('<i8', '>i8', 'no')
False
 >>> np.can_cast('<i8', '>i8', 'equiv')
True
>>> np.can_cast('<i4', '>i8', 'equiv')
False
 >>> np.can_cast('<i4', '>i8', 'safe')
True
>>> np.can_cast('<i8', '>i4', 'safe')
False
 >>> np.can_cast('<i8', '>i4', 'same_kind')
True
>>> np.can_cast('<i8', '>u4', 'same_kind')
False
 >>> np.can_cast('<i8', '>u4', 'unsafe')
True
numpy.cbrt   numpy.cbrt(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'cbrt'>
 
Return the cube-root of an array, element-wise.  New in version 1.10.0.   Parameters 
 
xarray_like


The values whose cube-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 cube cube-root of each element in x. If out was provided, y is a reference to it. This is a scalar if x is a scalar.     Examples >>> np.cbrt([1,8,27])
array([ 1.,  2.,  3.])
class numpy.cdouble(real=0, imag=0)[source]
 
Complex number type composed of two double-precision floating-point numbers, compatible with Python complex.  Character code 
'D'  Alias 
numpy.cfloat  Alias 
numpy.complex_  Alias on this platform (Linux x86_64) 
numpy.complex128: Complex number type composed of 2 64-bit-precision floating-point numbers.
numpy.ceil   numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'ceil'>
 
Return the ceiling of the input, element-wise. The ceil of the scalar x is the smallest integer i, such that i >= x. It is often denoted as \(\lceil x \rceil\).  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 
 
yndarray or scalar


The ceiling of each element in x, with float dtype. This is a scalar if x is a scalar.      See also  
floor, trunc, rint, fix

  Examples >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
>>> np.ceil(a)
array([-1., -1., -0.,  1.,  2.,  2.,  2.])
numpy.clip   numpy.clip(a, a_min, a_max, out=None, **kwargs)[source]
 
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_arrayndarray


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])
class numpy.clongdouble[source]
 
Complex number type composed of two extended-precision floating-point numbers.  Character code 
'G'  Alias 
numpy.clongfloat  Alias 
numpy.longcomplex  Alias on this platform (Linux x86_64) 
numpy.complex256: Complex number type composed of 2 128-bit extended-precision floating-point numbers.
numpy.clongfloat[source]
 
alias of numpy.clongdouble
numpy.column_stack   numpy.column_stack(tup)[source]
 
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

  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.common_type   numpy.common_type(*arrays)[source]
 
Return a scalar type which is common to the input arrays. The return type will always be an inexact (i.e. floating point) scalar type, even if all the arrays are integer arrays. If one of the inputs is an integer array, the minimum precision type that is returned is a 64-bit floating point dtype. All input arrays except int64 and uint64 can be safely cast to the returned dtype without loss of information.  Parameters 
 
array1, array2, …ndarrays


Input arrays.    Returns 
 
outdata type code


Data type code.      See also  
dtype, mintypecode

  Examples >>> np.common_type(np.arange(2, dtype=np.float32))
<class 'numpy.float32'>
>>> np.common_type(np.arange(2, dtype=np.float32), np.arange(2))
<class 'numpy.float64'>
>>> np.common_type(np.arange(4), np.array([45, 6.j]), np.array([45.0]))
<class 'numpy.complex128'>
numpy.complex192
  numpy.complex256[source]
 
Alias for numpy.clongdouble, named after its size in bits. The existence of these aliases depends on the platform.
numpy.compress   numpy.compress(condition, a, axis=None, out=None)[source]
 
Return selected slices of an array along given axis. When working along a given axis, a slice along that axis is returned in output for each index where condition evaluates to True. When working on a 1-D array, compress is equivalent to extract.  Parameters 
 
condition1-D array of bools


Array that selects which entries to return. If len(condition) is less than the size of a along the given axis, then output is truncated to the length of the condition array.  
aarray_like


Array from which to extract a part.  
axisint, optional


Axis along which to take slices. If None (default), work on the flattened array.  
outndarray, optional


Output array. Its type is preserved and it must be of the right shape to hold the output.    Returns 
 
compressed_arrayndarray


A copy of a without the slices along axis for which condition is false.      See also  
take, choose, diag, diagonal, select

ndarray.compress

Equivalent method in ndarray  extract

Equivalent method when working on 1-D arrays  Output type determination
  Examples >>> a = np.array([[1, 2], [3, 4], [5, 6]])
>>> a
array([[1, 2],
       [3, 4],
       [5, 6]])
>>> np.compress([0, 1], a, axis=0)
array([[3, 4]])
>>> np.compress([False, True, True], a, axis=0)
array([[3, 4],
       [5, 6]])
>>> np.compress([False, True], a, axis=1)
array([[2],
       [4],
       [6]])
 Working on the flattened array does not return slices along an axis but selects elements. >>> np.compress([False, True], a)
array([2])
numpy.concatenate   numpy.concatenate((a1, a2, ...), axis=0, out=None, dtype=None, casting="same_kind")
 
Join a sequence of arrays along an existing axis.  Parameters 
 
a1, a2, …sequence 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. If axis is None, arrays are flattened before use. Default is 0.  
outndarray, optional


If provided, the destination to place the result. The shape must be correct, matching that of what concatenate would have returned if no out argument were specified.  
dtypestr or dtype


If provided, the destination array will have this dtype. Cannot be provided together with out.  New in version 1.20.0.   
casting{‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional


Controls what kind of data casting may occur. Defaults to ‘same_kind’.  New in version 1.20.0.     Returns 
 
resndarray


The concatenated array.      See also  ma.concatenate

Concatenate function that preserves input masks.  array_split

Split an array into multiple sub-arrays of equal or near-equal size.  split

Split array into a list of multiple sub-arrays of equal size.  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).  stack

Stack a sequence of arrays along a new axis.  block

Assemble arrays from blocks.  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).  column_stack

Stack 1-D arrays as columns into a 2-D array.    Notes When one or more of the arrays to be concatenated is a MaskedArray, this function will return a MaskedArray object instead of an ndarray, but the input masks are not preserved. In cases where a MaskedArray is expected as input, use the ma.concatenate function from the masked array module instead. Examples >>> a = np.array([[1, 2], [3, 4]])
>>> b = np.array([[5, 6]])
>>> np.concatenate((a, b), axis=0)
array([[1, 2],
       [3, 4],
       [5, 6]])
>>> np.concatenate((a, b.T), axis=1)
array([[1, 2, 5],
       [3, 4, 6]])
>>> np.concatenate((a, b), axis=None)
array([1, 2, 3, 4, 5, 6])
 This function will not preserve masking of MaskedArray inputs. >>> a = np.ma.arange(3)
>>> a[1] = np.ma.masked
>>> b = np.arange(2, 5)
>>> a
masked_array(data=[0, --, 2],
             mask=[False,  True, False],
       fill_value=999999)
>>> b
array([2, 3, 4])
>>> np.concatenate([a, b])
masked_array(data=[0, 1, 2, 2, 3, 4],
             mask=False,
       fill_value=999999)
>>> np.ma.concatenate([a, b])
masked_array(data=[0, --, 2, 2, 3, 4],
             mask=[False,  True, False, False, False, False],
       fill_value=999999)
numpy.conj   numpy.conj(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'conjugate'>
 
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.conjugate   numpy.conjugate(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'conjugate'>
 
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]])