neulab/docprompting-conala huggingface dataset:
numpy.char.chararray.lstrip method   char.chararray.lstrip(chars=None)[source]
 
For each element in self, return a copy with the leading characters removed.  See also  char.lstrip
numpy.char.chararray.nbytes attribute   char.chararray.nbytes
 
Total bytes consumed by the elements of the array. Notes Does not include memory consumed by non-element attributes of the array object. Examples >>> x = np.zeros((3,5,2), dtype=np.complex128)
>>> x.nbytes
480
>>> np.prod(x.shape) * x.itemsize
480
numpy.char.chararray.ndim attribute   char.chararray.ndim
 
Number of array dimensions. Examples >>> x = np.array([1, 2, 3])
>>> x.ndim
1
>>> y = np.zeros((2, 3, 4))
>>> y.ndim
3
numpy.char.chararray.nonzero method   char.chararray.nonzero()
 
Return the indices of the elements that are non-zero. Refer to numpy.nonzero for full documentation.  See also  numpy.nonzero

equivalent function
numpy.char.chararray.put method   char.chararray.put(indices, values, mode='raise')
 
Set a.flat[n] = values[n] for all n in indices. Refer to numpy.put for full documentation.  See also  numpy.put

equivalent function
numpy.char.chararray.ravel method   char.chararray.ravel([order])
 
Return a flattened array. Refer to numpy.ravel for full documentation.  See also  numpy.ravel

equivalent function  ndarray.flat

a flat iterator on the array.
numpy.char.chararray.real attribute   char.chararray.real
 
The real part of the array.  See also  numpy.real

equivalent function    Examples >>> x = np.sqrt([1+0j, 0+1j])
>>> x.real
array([ 1.        ,  0.70710678])
>>> x.real.dtype
dtype('float64')
numpy.char.chararray.repeat method   char.chararray.repeat(repeats, axis=None)
 
Repeat elements of an array. Refer to numpy.repeat for full documentation.  See also  numpy.repeat

equivalent function
numpy.char.chararray.replace method   char.chararray.replace(old, new, count=None)[source]
 
For each element in self, return a copy of the string with all occurrences of substring old replaced by new.  See also  char.replace
numpy.char.chararray.reshape method   char.chararray.reshape(shape, order='C')
 
Returns an array containing the same data with a new shape. Refer to numpy.reshape for full documentation.  See also  numpy.reshape

equivalent function    Notes Unlike the free function numpy.reshape, this method on ndarray allows the elements of the shape parameter to be passed in as separate arguments. For example, a.reshape(10, 11) is equivalent to a.reshape((10, 11)).
numpy.char.chararray.resize method   char.chararray.resize(new_shape, refcheck=True)
 
Change shape and size of array in-place.  Parameters 
 
new_shapetuple of ints, or n ints


Shape of resized array.  
refcheckbool, optional


If False, reference count will not be checked. Default is True.    Returns 
 None
  Raises 
 ValueError

If a does not own its own data or references or views to it exist, and the data memory must be changed. PyPy only: will always raise if the data memory must be changed, since there is no reliable way to determine if references or views to it exist.  SystemError

If the order keyword argument is specified. This behaviour is a bug in NumPy.      See also  resize

Return a new array with the specified shape.    Notes This reallocates space for the data area if necessary. Only contiguous arrays (data elements consecutive in memory) can be resized. The purpose of the reference count check is to make sure you do not use this array as a buffer for another Python object and then reallocate the memory. However, reference counts can increase in other ways so if you are sure that you have not shared the memory for this array with another Python object, then you may safely set refcheck to False. Examples Shrinking an array: array is flattened (in the order that the data are stored in memory), resized, and reshaped: >>> a = np.array([[0, 1], [2, 3]], order='C')
>>> a.resize((2, 1))
>>> a
array([[0],
       [1]])
 >>> a = np.array([[0, 1], [2, 3]], order='F')
>>> a.resize((2, 1))
>>> a
array([[0],
       [2]])
 Enlarging an array: as above, but missing entries are filled with zeros: >>> b = np.array([[0, 1], [2, 3]])
>>> b.resize(2, 3) # new_shape parameter doesn't have to be a tuple
>>> b
array([[0, 1, 2],
       [3, 0, 0]])
 Referencing an array prevents resizing… >>> c = a
>>> a.resize((1, 1))
Traceback (most recent call last):
...
ValueError: cannot resize an array that references or is referenced ...
 Unless refcheck is False: >>> a.resize((1, 1), refcheck=False)
>>> a
array([[0]])
>>> c
array([[0]])
numpy.char.chararray.rfind method   char.chararray.rfind(sub, start=0, end=None)[source]
 
For each element in self, return the highest index in the string where substring sub is found, such that sub is contained within [start, end].  See also  char.rfind
numpy.char.chararray.rindex method   char.chararray.rindex(sub, start=0, end=None)[source]
 
Like rfind, but raises ValueError when the substring sub is not found.  See also  char.rindex
numpy.char.chararray.rjust method   char.chararray.rjust(width, fillchar=' ')[source]
 
Return an array with the elements of self right-justified in a string of length width.  See also  char.rjust
numpy.char.chararray.rsplit method   char.chararray.rsplit(sep=None, maxsplit=None)[source]
 
For each element in self, return a list of the words in the string, using sep as the delimiter string.  See also  char.rsplit
numpy.char.chararray.rstrip method   char.chararray.rstrip(chars=None)[source]
 
For each element in self, return a copy with the trailing characters removed.  See also  char.rstrip
numpy.char.chararray.searchsorted method   char.chararray.searchsorted(v, side='left', sorter=None)
 
Find indices where elements of v should be inserted in a to maintain order. For full documentation, see numpy.searchsorted  See also  numpy.searchsorted

equivalent function
numpy.char.chararray.setfield method   char.chararray.setfield(val, dtype, offset=0)
 
Put a value into a specified place in a field defined by a data-type. Place val into a’s field defined by dtype and beginning offset bytes into the field.  Parameters 
 
valobject


Value to be placed in field.  
dtypedtype object


Data-type of the field in which to place val.  
offsetint, optional


The number of bytes into the field at which to place val.    Returns 
 None
    See also  getfield
  Examples >>> x = np.eye(3)
>>> x.getfield(np.float64)
array([[1.,  0.,  0.],
       [0.,  1.,  0.],
       [0.,  0.,  1.]])
>>> x.setfield(3, np.int32)
>>> x.getfield(np.int32)
array([[3, 3, 3],
       [3, 3, 3],
       [3, 3, 3]], dtype=int32)
>>> x
array([[1.0e+000, 1.5e-323, 1.5e-323],
       [1.5e-323, 1.0e+000, 1.5e-323],
       [1.5e-323, 1.5e-323, 1.0e+000]])
>>> x.setfield(np.eye(3), np.int32)
>>> x
array([[1.,  0.,  0.],
       [0.,  1.,  0.],
       [0.,  0.,  1.]])
numpy.char.chararray.setflags method   char.chararray.setflags(write=None, align=None, uic=None)
 
Set array flags WRITEABLE, ALIGNED, (WRITEBACKIFCOPY and UPDATEIFCOPY), respectively. These Boolean-valued flags affect how numpy interprets the memory area used by a (see Notes below). The ALIGNED flag can only be set to True if the data is actually aligned according to the type. The WRITEBACKIFCOPY and (deprecated) UPDATEIFCOPY flags can never be set to True. The flag WRITEABLE can only be set to True if the array owns its own memory, or the ultimate owner of the memory exposes a writeable buffer interface, or is a string. (The exception for string is made so that unpickling can be done without copying memory.)  Parameters 
 
writebool, optional


Describes whether or not a can be written to.  
alignbool, optional


Describes whether or not a is aligned properly for its type.  
uicbool, optional


Describes whether or not a is a copy of another “base” array.     Notes Array flags provide information about how the memory area used for the array is to be interpreted. There are 7 Boolean flags in use, only four of which can be changed by the user: WRITEBACKIFCOPY, UPDATEIFCOPY, WRITEABLE, and ALIGNED. WRITEABLE (W) the data area can be written to; ALIGNED (A) the data and strides are aligned appropriately for the hardware (as determined by the compiler); UPDATEIFCOPY (U) (deprecated), replaced by WRITEBACKIFCOPY; WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced by .base). When the C-API function PyArray_ResolveWritebackIfCopy is called, the base array will be updated with the contents of this array. All flags can be accessed using the single (upper case) letter as well as the full name. Examples >>> y = np.array([[3, 1, 7],
...               [2, 0, 0],
...               [8, 5, 9]])
>>> y
array([[3, 1, 7],
       [2, 0, 0],
       [8, 5, 9]])
>>> y.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False
  UPDATEIFCOPY : False
>>> y.setflags(write=0, align=0)
>>> y.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : True
  WRITEABLE : False
  ALIGNED : False
  WRITEBACKIFCOPY : False
  UPDATEIFCOPY : False
>>> y.setflags(uic=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: cannot set WRITEBACKIFCOPY flag to True
numpy.char.chararray.shape attribute   char.chararray.shape
 
Tuple of array dimensions. The shape property is usually used to get the current shape of an array, but may also be used to reshape the array in-place by assigning a tuple of array dimensions to it. As with numpy.reshape, one of the new shape dimensions can be -1, in which case its value is inferred from the size of the array and the remaining dimensions. Reshaping an array in-place will fail if a copy is required.  See also  numpy.reshape

similar function  ndarray.reshape

similar method    Examples >>> x = np.array([1, 2, 3, 4])
>>> x.shape
(4,)
>>> y = np.zeros((2, 3, 4))
>>> y.shape
(2, 3, 4)
>>> y.shape = (3, 8)
>>> y
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
>>> y.shape = (3, 6)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: total size of new array must be unchanged
>>> np.zeros((4,2))[::2].shape = (-1,)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: Incompatible shape for in-place modification. Use
`.reshape()` to make a copy with the desired shape.
numpy.char.chararray.size attribute   char.chararray.size
 
Number of elements in the array. Equal to np.prod(a.shape), i.e., the product of the array’s dimensions. Notes a.size returns a standard arbitrary precision Python integer. This may not be the case with other methods of obtaining the same value (like the suggested np.prod(a.shape), which returns an instance of np.int_), and may be relevant if the value is used further in calculations that may overflow a fixed size integer type. Examples >>> x = np.zeros((3, 5, 2), dtype=np.complex128)
>>> x.size
30
>>> np.prod(x.shape)
30
numpy.char.chararray.sort method   char.chararray.sort(axis=- 1, kind=None, order=None)
 
Sort an array in-place. Refer to numpy.sort for full documentation.  Parameters 
 
axisint, optional


Axis along which to sort. Default is -1, which means sort along the last axis.  
kind{‘quicksort’, ‘mergesort’, ‘heapsort’, ‘stable’}, optional


Sorting algorithm. The default is ‘quicksort’. Note that both ‘stable’ and ‘mergesort’ use timsort under the covers and, in general, the actual implementation will vary with datatype. The ‘mergesort’ option is retained for backwards compatibility.  Changed in version 1.15.0: The ‘stable’ option was added.   
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, and 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.      See also  numpy.sort

Return a sorted copy of an array.  numpy.argsort

Indirect sort.  numpy.lexsort

Indirect stable sort on multiple keys.  numpy.searchsorted

Find elements in sorted array.  numpy.partition

Partial sort.    Notes See numpy.sort for notes on the different sorting algorithms. Examples >>> a = np.array([[1,4], [3,1]])
>>> a.sort(axis=1)
>>> a
array([[1, 4],
       [1, 3]])
>>> a.sort(axis=0)
>>> a
array([[1, 3],
       [1, 4]])
 Use the order keyword to specify a field to use when sorting a structured array: >>> a = np.array([('a', 2), ('c', 1)], dtype=[('x', 'S1'), ('y', int)])
>>> a.sort(order='y')
>>> a
array([(b'c', 1), (b'a', 2)],
      dtype=[('x', 'S1'), ('y', '<i8')])
numpy.char.chararray.split method   char.chararray.split(sep=None, maxsplit=None)[source]
 
For each element in self, return a list of the words in the string, using sep as the delimiter string.  See also  char.split
numpy.char.chararray.splitlines method   char.chararray.splitlines(keepends=None)[source]
 
For each element in self, return a list of the lines in the element, breaking at line boundaries.  See also  char.splitlines
numpy.char.chararray.squeeze method   char.chararray.squeeze(axis=None)
 
Remove axes of length one from a. Refer to numpy.squeeze for full documentation.  See also  numpy.squeeze

equivalent function
numpy.char.chararray.startswith method   char.chararray.startswith(prefix, start=0, end=None)[source]
 
Returns a boolean array which is True where the string element in self starts with prefix, otherwise False.  See also  char.startswith
numpy.char.chararray.strides attribute   char.chararray.strides
 
Tuple of bytes to step in each dimension when traversing an array. The byte offset of element (i[0], i[1], ..., i[n]) in an array a is: offset = sum(np.array(i) * a.strides)
 A more detailed explanation of strides can be found in the “ndarray.rst” file in the NumPy reference guide.  See also  numpy.lib.stride_tricks.as_strided
  Notes Imagine an array of 32-bit integers (each 4 bytes): x = np.array([[0, 1, 2, 3, 4],
              [5, 6, 7, 8, 9]], dtype=np.int32)
 This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position along a certain axis. For example, we have to skip 4 bytes (1 value) to move to the next column, but 20 bytes (5 values) to get to the same position in the next row. As such, the strides for the array x will be (20, 4). Examples >>> y = np.reshape(np.arange(2*3*4), (2,3,4))
>>> y
array([[[ 0,  1,  2,  3],
        [ 4,  5,  6,  7],
        [ 8,  9, 10, 11]],
       [[12, 13, 14, 15],
        [16, 17, 18, 19],
        [20, 21, 22, 23]]])
>>> y.strides
(48, 16, 4)
>>> y[1,1,1]
17
>>> offset=sum(y.strides * np.array((1,1,1)))
>>> offset/y.itemsize
17
 >>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
>>> x.strides
(32, 4, 224, 1344)
>>> i = np.array([3,5,2,2])
>>> offset = sum(i * x.strides)
>>> x[3,5,2,2]
813
>>> offset / x.itemsize
813
numpy.char.chararray.strip method   char.chararray.strip(chars=None)[source]
 
For each element in self, return a copy with the leading and trailing characters removed.  See also  char.strip
numpy.char.chararray.swapaxes method   char.chararray.swapaxes(axis1, axis2)
 
Return a view of the array with axis1 and axis2 interchanged. Refer to numpy.swapaxes for full documentation.  See also  numpy.swapaxes

equivalent function
numpy.char.chararray.swapcase method   char.chararray.swapcase()[source]
 
For each element in self, return a copy of the string with uppercase characters converted to lowercase and vice versa.  See also  char.swapcase
numpy.char.chararray.T attribute   char.chararray.T
 
The transposed array. Same as self.transpose().  See also  transpose
  Examples >>> x = np.array([[1.,2.],[3.,4.]])
>>> x
array([[ 1.,  2.],
       [ 3.,  4.]])
>>> x.T
array([[ 1.,  3.],
       [ 2.,  4.]])
>>> x = np.array([1.,2.,3.,4.])
>>> x
array([ 1.,  2.,  3.,  4.])
>>> x.T
array([ 1.,  2.,  3.,  4.])
numpy.char.chararray.take method   char.chararray.take(indices, axis=None, out=None, mode='raise')
 
Return an array formed from the elements of a at the given indices. Refer to numpy.take for full documentation.  See also  numpy.take

equivalent function
numpy.char.chararray.title method   char.chararray.title()[source]
 
For each element in self, return a titlecased version of the string: words start with uppercase characters, all remaining cased characters are lowercase.  See also  char.title
numpy.char.chararray.tobytes method   char.chararray.tobytes(order='C')
 
Construct Python bytes containing the raw data bytes in the array. Constructs Python bytes showing a copy of the raw contents of data memory. The bytes object is produced in C-order by default. This behavior is controlled by the order parameter.  New in version 1.9.0.   Parameters 
 
order{‘C’, ‘F’, ‘A’}, optional


Controls the memory layout of the bytes object. ‘C’ means C-order, ‘F’ means F-order, ‘A’ (short for Any) means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. Default is ‘C’.    Returns 
 
sbytes


Python bytes exhibiting a copy of a’s raw data.     Examples >>> x = np.array([[0, 1], [2, 3]], dtype='<u2')
>>> x.tobytes()
b'\x00\x00\x01\x00\x02\x00\x03\x00'
>>> x.tobytes('C') == x.tobytes()
True
>>> x.tobytes('F')
b'\x00\x00\x02\x00\x01\x00\x03\x00'
numpy.char.chararray.tofile method   char.chararray.tofile(fid, sep='', format='%s')
 
Write array to a file as text or binary (default). Data is always written in ‘C’ order, independent of the order of a. The data produced by this method can be recovered using the function fromfile().  Parameters 
 
fidfile or str or Path


An open file object, or a string containing a filename.  Changed in version 1.17.0: pathlib.Path objects are now accepted.   
sepstr


Separator between array items for text output. If “” (empty), a binary file is written, equivalent to file.write(a.tobytes()).  
formatstr


Format string for text file output. Each entry in the array is formatted to text by first converting it to the closest Python type, and then using “format” % item.     Notes This is a convenience function for quick storage of array data. Information on endianness and precision is lost, so this method is not a good choice for files intended to archive data or transport data between machines with different endianness. Some of these problems can be overcome by outputting the data as text files, at the expense of speed and file size. When fid is a file object, array contents are directly written to the file, bypassing the file object’s write method. As a result, tofile cannot be used with files objects supporting compression (e.g., GzipFile) or file-like objects that do not support fileno() (e.g., BytesIO).
numpy.char.chararray.tolist method   char.chararray.tolist()
 
Return the array as an a.ndim-levels deep nested list of Python scalars. Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item function. If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.  Parameters 
 none
  Returns 
 
yobject, or list of object, or list of list of object, or …


The possibly nested list of array elements.     Notes The array may be recreated via a = np.array(a.tolist()), although this may sometimes lose precision. Examples For a 1D array, a.tolist() is almost the same as list(a), except that tolist changes numpy scalars to Python scalars: >>> a = np.uint32([1, 2])
>>> a_list = list(a)
>>> a_list
[1, 2]
>>> type(a_list[0])
<class 'numpy.uint32'>
>>> a_tolist = a.tolist()
>>> a_tolist
[1, 2]
>>> type(a_tolist[0])
<class 'int'>
 Additionally, for a 2D array, tolist applies recursively: >>> a = np.array([[1, 2], [3, 4]])
>>> list(a)
[array([1, 2]), array([3, 4])]
>>> a.tolist()
[[1, 2], [3, 4]]
 The base case for this recursion is a 0D array: >>> a = np.array(1)
>>> list(a)
Traceback (most recent call last):
  ...
TypeError: iteration over a 0-d array
>>> a.tolist()
1
numpy.char.chararray.tostring method   char.chararray.tostring(order='C')
 
A compatibility alias for tobytes, with exactly the same behavior. Despite its name, it returns bytes not strs.  Deprecated since version 1.19.0.
numpy.char.chararray.translate method   char.chararray.translate(table, deletechars=None)[source]
 
For each element in self, return a copy of the string where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table.  See also  char.translate
numpy.char.chararray.transpose method   char.chararray.transpose(*axes)
 
Returns a view of the array with axes transposed. For a 1-D array this has no effect, as a transposed vector is simply the same vector. To convert a 1-D array into a 2D column vector, an additional dimension must be added. np.atleast2d(a).T achieves this, as does a[:, np.newaxis]. For a 2-D array, this is a standard matrix transpose. For an n-D array, if axes are given, their order indicates how the axes are permuted (see Examples). If axes are not provided and a.shape = (i[0], i[1], ... i[n-2], i[n-1]), then a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0]).  Parameters 
 
axesNone, tuple of ints, or n ints


 None or no argument: reverses the order of the axes. tuple of ints: i in the j-th place in the tuple means a’s i-th axis becomes a.transpose()’s j-th axis. 
n ints: same as an n-tuple of the same ints (this form is intended simply as a “convenience” alternative to the tuple form)     Returns 
 
outndarray


View of a, with axes suitably permuted.      See also  transpose

Equivalent function  ndarray.T

Array property returning the array transposed.  ndarray.reshape

Give a new shape to an array without changing its data.    Examples >>> a = np.array([[1, 2], [3, 4]])
>>> a
array([[1, 2],
       [3, 4]])
>>> a.transpose()
array([[1, 3],
       [2, 4]])
>>> a.transpose((1, 0))
array([[1, 3],
       [2, 4]])
>>> a.transpose(1, 0)
array([[1, 3],
       [2, 4]])
numpy.char.chararray.upper method   char.chararray.upper()[source]
 
Return an array with the elements of self converted to uppercase.  See also  char.upper