neulab/docprompting-conala huggingface dataset:
numpy.fft.rfftn   fft.rfftn(a, s=None, axes=None, norm=None)[source]
 
Compute the N-dimensional discrete Fourier Transform for real input. This function computes the N-dimensional discrete Fourier Transform over any number of axes in an M-dimensional real array by means of the Fast Fourier Transform (FFT). By default, all axes are transformed, with the real transform performed over the last axis, while the remaining transforms are complex.  Parameters 
 
aarray_like


Input array, taken to be real.  
ssequence of ints, optional


Shape (length along each transformed axis) to use from the input. (s[0] refers to axis 0, s[1] to axis 1, etc.). The final element of s corresponds to n for rfft(x, n), while for the remaining axes, it corresponds to n for fft(x, n). Along any axis, if the given shape is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. if s is not given, the shape of the input along the axes specified by axes is used.  
axessequence of ints, optional


Axes over which to compute the FFT. If not given, the last len(s) axes are used, or all axes if s is also not specified.  
norm{“backward”, “ortho”, “forward”}, optional


 New in version 1.10.0.  Normalization mode (see numpy.fft). Default is “backward”. Indicates which direction of the forward/backward pair of transforms is scaled and with what normalization factor.  New in version 1.20.0: The “backward”, “forward” values were added.     Returns 
 
outcomplex ndarray


The truncated or zero-padded input, transformed along the axes indicated by axes, or by a combination of s and a, as explained in the parameters section above. The length of the last axis transformed will be s[-1]//2+1, while the remaining transformed axes will have lengths according to s, or unchanged from the input.    Raises 
 ValueError

If s and axes have different length.  IndexError

If an element of axes is larger than than the number of axes of a.      See also  irfftn

The inverse of rfftn, i.e. the inverse of the n-dimensional FFT of real input.  fft

The one-dimensional FFT, with definitions and conventions used.  rfft

The one-dimensional FFT of real input.  fftn

The n-dimensional FFT.  rfft2

The two-dimensional FFT of real input.    Notes The transform for real input is performed over the last transformation axis, as by rfft, then the transform over the remaining axes is performed as by fftn. The order of the output is as for rfft for the final transformation axis, and as for fftn for the remaining transformation axes. See fft for details, definitions and conventions used. Examples >>> a = np.ones((2, 2, 2))
>>> np.fft.rfftn(a)
array([[[8.+0.j,  0.+0.j], # may vary
        [0.+0.j,  0.+0.j]],
       [[0.+0.j,  0.+0.j],
        [0.+0.j,  0.+0.j]]])
 >>> np.fft.rfftn(a, axes=(2, 0))
array([[[4.+0.j,  0.+0.j], # may vary
        [4.+0.j,  0.+0.j]],
       [[0.+0.j,  0.+0.j],
        [0.+0.j,  0.+0.j]]])
numpy.flatiter.base attribute   flatiter.base
 
A reference to the array that is iterated over. Examples >>> x = np.arange(5)
>>> fl = x.flat
>>> fl.base is x
True
numpy.flatiter.coords attribute   flatiter.coords
 
An N-dimensional tuple of current coordinates. Examples >>> x = np.arange(6).reshape(2, 3)
>>> fl = x.flat
>>> fl.coords
(0, 0)
>>> next(fl)
0
>>> fl.coords
(0, 1)
numpy.flatiter.copy method   flatiter.copy()
 
Get a copy of the iterator as a 1-D array. Examples >>> x = np.arange(6).reshape(2, 3)
>>> x
array([[0, 1, 2],
       [3, 4, 5]])
>>> fl = x.flat
>>> fl.copy()
array([0, 1, 2, 3, 4, 5])
numpy.flatiter.index attribute   flatiter.index
 
Current flat index into the array. Examples >>> x = np.arange(6).reshape(2, 3)
>>> fl = x.flat
>>> fl.index
0
>>> next(fl)
0
>>> fl.index
1
numpy.generic.__array__ method   generic.__array__()
 
sc.__array__(dtype) return 0-dim array from scalar with specified dtype
numpy.generic.__array_interface__ attribute   generic.__array_interface__
 
Array protocol: Python side
numpy.generic.__array_priority__ attribute   generic.__array_priority__
 
Array priority.
numpy.generic.__array_struct__ attribute   generic.__array_struct__
 
Array protocol: struct
numpy.generic.__array_wrap__ method   generic.__array_wrap__()
 
sc.__array_wrap__(obj) return scalar from array
numpy.generic.base attribute   generic.base
 
Scalar attribute identical to the corresponding array attribute. Please see ndarray.base.
numpy.generic.byteswap method   generic.byteswap()
 
Scalar method identical to the corresponding array attribute. Please see ndarray.byteswap.
numpy.generic.flat attribute   generic.flat
 
A 1-D view of the scalar.
numpy.generic.imag attribute   generic.imag
 
The imaginary part of the scalar.
numpy.generic.itemsize attribute   generic.itemsize
 
The length of one element in bytes.
numpy.generic.ndim attribute   generic.ndim
 
The number of array dimensions.
numpy.generic.setflags method   generic.setflags()
 
Scalar method identical to the corresponding array attribute. Please see ndarray.setflags.
numpy.generic.size attribute   generic.size
 
The number of elements in the gentype.
numpy.generic.squeeze method   generic.squeeze()
 
Scalar method identical to the corresponding array attribute. Please see ndarray.squeeze.
numpy.generic.strides attribute   generic.strides
 
Tuple of bytes steps in each dimension.
numpy.generic.T attribute   generic.T
 
Scalar attribute identical to the corresponding array attribute. Please see ndarray.T.
get_build_temp_dir()[source]
 
Return a path to a temporary directory where temporary files should be placed.
get_config_cmd()[source]
 
Returns the numpy.distutils config command instance.
get_info(*names)[source]
 
Get resources information. Return information (from system_info.get_info) for all of the names in the argument list in a single dictionary.
get_subpackage(subpackage_name, subpackage_path=None, parent_name=None, caller_level=1)[source]
 
Return list of subpackage configurations.  Parameters 
 
subpackage_namestr or None


Name of the subpackage to get the configuration. ‘*’ in subpackage_name is handled as a wildcard.  
subpackage_pathstr


If None, then the path is assumed to be the local path plus the subpackage_name. If a setup.py file is not found in the subpackage_path, then a default configuration is used.  
parent_namestr


Parent name.
get_version(version_file=None, version_variable=None)[source]
 
Try to get version string of a package. Return a version string of the current package or None if the version information could not be detected. Notes This method scans files named __version__.py, <packagename>_version.py, version.py, and __svn_version__.py for string variables version, __version__, and <packagename>_version, until a version number is found.
have_f77c()[source]
 
Check for availability of Fortran 77 compiler. Use it inside source generating function to ensure that setup distribution instance has been initialized. Notes True if a Fortran 77 compiler is available (because a simple Fortran 77 code was able to be compiled successfully).
have_f90c()[source]
 
Check for availability of Fortran 90 compiler. Use it inside source generating function to ensure that setup distribution instance has been initialized. Notes True if a Fortran 90 compiler is available (because a simple Fortran 90 code was able to be compiled successfully)
numpy.lib.format.descr_to_dtype   lib.format.descr_to_dtype(descr)[source]
 
Returns a dtype based off the given description. This is essentially the reverse of dtype_to_descr(). It will remove the valueless padding fields created by, i.e. simple fields like dtype(‘float32’), and then convert the description to its corresponding dtype.  Parameters 
 
descrobject


The object retrieved by dtype.descr. Can be passed to numpy.dtype() in order to replicate the input dtype.    Returns 
 
dtypedtype


The dtype constructed by the description.
numpy.lib.format.dtype_to_descr   lib.format.dtype_to_descr(dtype)[source]
 
Get a serializable descriptor from the dtype. The .descr attribute of a dtype object cannot be round-tripped through the dtype() constructor. Simple types, like dtype(‘float32’), have a descr which looks like a record array with one field with ‘’ as a name. The dtype() constructor interprets this as a request to give a default name. Instead, we construct descriptor that can be passed to dtype().  Parameters 
 
dtypedtype


The dtype of the array that will be written to disk.    Returns 
 
descrobject


An object that can be passed to numpy.dtype() in order to replicate the input dtype.
numpy.lib.format.header_data_from_array_1_0   lib.format.header_data_from_array_1_0(array)[source]
 
Get the dictionary of header metadata from a numpy.ndarray.  Parameters 
 
arraynumpy.ndarray

  Returns 
 
ddict


This has the appropriate entries for writing its string representation to the header of the file.
numpy.lib.format.magic   lib.format.magic(major, minor)[source]
 
Return the magic string for the given file format version.  Parameters 
 
majorint in [0, 255]


minorint in [0, 255]

  Returns 
 
magicstr

  Raises 
 ValueError if the version cannot be formatted.
numpy.lib.format.open_memmap   lib.format.open_memmap(filename, mode='r+', dtype=None, shape=None, fortran_order=False, version=None)[source]
 
Open a .npy file as a memory-mapped array. This may be used to read an existing file or create a new one.  Parameters 
 
filenamestr or path-like


The name of the file on disk. This may not be a file-like object.  
modestr, optional


The mode in which to open the file; the default is ‘r+’. In addition to the standard file modes, ‘c’ is also accepted to mean “copy on write.” See memmap for the available mode strings.  
dtypedata-type, optional


The data type of the array if we are creating a new file in “write” mode, if not, dtype is ignored. The default value is None, which results in a data-type of float64.  
shapetuple of int


The shape of the array if we are creating a new file in “write” mode, in which case this parameter is required. Otherwise, this parameter is ignored and is thus optional.  
fortran_orderbool, optional


Whether the array should be Fortran-contiguous (True) or C-contiguous (False, the default) if we are creating a new file in “write” mode.  
versiontuple of int (major, minor) or None


If the mode is a “write” mode, then this is the version of the file format used to create the file. None means use the oldest supported version that is able to store the data. Default: None    Returns 
 
marraymemmap


The memory-mapped array.    Raises 
 ValueError

If the data or the mode is invalid.  OSError

If the file is not found or cannot be opened correctly.      See also  numpy.memmap
numpy.lib.format.read_array   lib.format.read_array(fp, allow_pickle=False, pickle_kwargs=None)[source]
 
Read an array from an NPY file.  Parameters 
 
fpfile_like object


If this is not a real file object, then this may take extra memory and time.  
allow_picklebool, optional


Whether to allow writing pickled data. Default: False  Changed in version 1.16.3: Made default False in response to CVE-2019-6446.   
pickle_kwargsdict


Additional keyword arguments to pass to pickle.load. These are only useful when loading object arrays saved on Python 2 when using Python 3.    Returns 
 
arrayndarray


The array from the data on disk.    Raises 
 ValueError

If the data is invalid, or allow_pickle=False and the file contains an object array.
numpy.lib.format.read_array_header_1_0   lib.format.read_array_header_1_0(fp)[source]
 
Read an array header from a filelike object using the 1.0 file format version. This will leave the file object located just after the header.  Parameters 
 
fpfilelike object


A file object or something with a read() method like a file.    Returns 
 
shapetuple of int


The shape of the array.  
fortran_orderbool


The array data will be written out directly if it is either C-contiguous or Fortran-contiguous. Otherwise, it will be made contiguous before writing it out.  
dtypedtype


The dtype of the file’s data.    Raises 
 ValueError

If the data is invalid.
numpy.lib.format.read_array_header_2_0   lib.format.read_array_header_2_0(fp)[source]
 
Read an array header from a filelike object using the 2.0 file format version. This will leave the file object located just after the header.  New in version 1.9.0.   Parameters 
 
fpfilelike object


A file object or something with a read() method like a file.    Returns 
 
shapetuple of int


The shape of the array.  
fortran_orderbool


The array data will be written out directly if it is either C-contiguous or Fortran-contiguous. Otherwise, it will be made contiguous before writing it out.  
dtypedtype


The dtype of the file’s data.    Raises 
 ValueError

If the data is invalid.
numpy.lib.format.read_magic   lib.format.read_magic(fp)[source]
 
Read the magic string to get the version of the file format.  Parameters 
 
fpfilelike object

  Returns 
 
majorint


minorint
numpy.lib.format.write_array   lib.format.write_array(fp, array, version=None, allow_pickle=True, pickle_kwargs=None)[source]
 
Write an array to an NPY file, including a header. If the array is neither C-contiguous nor Fortran-contiguous AND the file_like object is not a real file object, this function will have to copy data in memory.  Parameters 
 
fpfile_like object


An open, writable file object, or similar object with a .write() method.  
arrayndarray


The array to write to disk.  
version(int, int) or None, optional


The version number of the format. None means use the oldest supported version that is able to store the data. Default: None  
allow_picklebool, optional


Whether to allow writing pickled data. Default: True  
pickle_kwargsdict, optional


Additional keyword arguments to pass to pickle.dump, excluding ‘protocol’. These are only useful when pickling objects in object arrays on Python 3 to Python 2 compatible format.    Raises 
 ValueError

If the array cannot be persisted. This includes the case of allow_pickle=False and array being an object array.  Various other errors

If the array contains Python objects as part of its dtype, the process of pickling them may raise various errors if the objects are not picklable.
numpy.lib.format.write_array_header_1_0   lib.format.write_array_header_1_0(fp, d)[source]
 
Write the header for an array using the 1.0 format.  Parameters 
 
fpfilelike object


ddict


This has the appropriate entries for writing its string representation to the header of the file.
numpy.lib.format.write_array_header_2_0   lib.format.write_array_header_2_0(fp, d)[source]
 
 Write the header for an array using the 2.0 format.

The 2.0 format allows storing very large structured arrays.    New in version 1.9.0.   Parameters 
 
fpfilelike object


ddict


This has the appropriate entries for writing its string representation to the header of the file.
numpy.lib.scimath.arccos   lib.scimath.arccos(x)[source]
 
Compute the inverse cosine of x. Return the “principal value” (for a description of this, see numpy.arccos) of the inverse cosine of x. For real x such that abs(x) <= 1, this is a real number in the closed interval \([0, \pi]\). Otherwise, the complex principle value is returned.  Parameters 
 
xarray_like or scalar


The value(s) whose arccos is (are) required.    Returns 
 
outndarray or scalar


The inverse cosine(s) of the x value(s). If x was a scalar, so is out, otherwise an array object is returned.      See also  numpy.arccos
  Notes For an arccos() that returns NAN when real x is not in the interval [-1,1], use numpy.arccos. Examples >>> np.set_printoptions(precision=4)
 >>> np.emath.arccos(1) # a scalar is returned
0.0
 >>> np.emath.arccos([1,2])
array([0.-0.j   , 0.-1.317j])
numpy.lib.scimath.arcsin   lib.scimath.arcsin(x)[source]
 
Compute the inverse sine of x. Return the “principal value” (for a description of this, see numpy.arcsin) of the inverse sine of x. For real x such that abs(x) <= 1, this is a real number in the closed interval \([-\pi/2, \pi/2]\). Otherwise, the complex principle value is returned.  Parameters 
 
xarray_like or scalar


The value(s) whose arcsin is (are) required.    Returns 
 
outndarray or scalar


The inverse sine(s) of the x value(s). If x was a scalar, so is out, otherwise an array object is returned.      See also  numpy.arcsin
  Notes For an arcsin() that returns NAN when real x is not in the interval [-1,1], use numpy.arcsin. Examples >>> np.set_printoptions(precision=4)
 >>> np.emath.arcsin(0)
0.0
 >>> np.emath.arcsin([0,1])
array([0.    , 1.5708])
numpy.lib.scimath.arctanh   lib.scimath.arctanh(x)[source]
 
Compute the inverse hyperbolic tangent of x. Return the “principal value” (for a description of this, see numpy.arctanh) of arctanh(x). For real x such that abs(x) < 1, this is a real number. If abs(x) > 1, or if x is complex, the result is complex. Finally, x = 1 returns``inf`` and x=-1 returns -inf.  Parameters 
 
xarray_like


The value(s) whose arctanh is (are) required.    Returns 
 
outndarray or scalar


The inverse hyperbolic tangent(s) of the x value(s). If x was a scalar so is out, otherwise an array is returned.      See also  numpy.arctanh
  Notes For an arctanh() that returns NAN when real x is not in the interval (-1,1), use numpy.arctanh (this latter, however, does return +/-inf for x = +/-1). Examples >>> np.set_printoptions(precision=4)
 >>> from numpy.testing import suppress_warnings
>>> with suppress_warnings() as sup:
...     sup.filter(RuntimeWarning)
...     np.emath.arctanh(np.eye(2))
array([[inf,  0.],
       [ 0., inf]])
>>> np.emath.arctanh([1j])
array([0.+0.7854j])
numpy.lib.scimath.log   lib.scimath.log(x)[source]
 
Compute the natural logarithm of x. Return the “principal value” (for a description of this, see numpy.log) of \(log_e(x)\). For real x > 0, this is a real number (log(0) returns -inf and log(np.inf) returns inf). Otherwise, the complex principle value is returned.  Parameters 
 
xarray_like


The value(s) whose log is (are) required.    Returns 
 
outndarray or scalar


The log of the x value(s). If x was a scalar, so is out, otherwise an array is returned.      See also  numpy.log
  Notes For a log() that returns NAN when real x < 0, use numpy.log (note, however, that otherwise numpy.log and this log are identical, i.e., both return -inf for x = 0, inf for x = inf, and, notably, the complex principle value if x.imag != 0). Examples >>> np.emath.log(np.exp(1))
1.0
 Negative arguments are handled “correctly” (recall that exp(log(x)) == x does not hold for real x < 0): >>> np.emath.log(-np.exp(1)) == (1 + np.pi * 1j)
True
numpy.lib.scimath.log10   lib.scimath.log10(x)[source]
 
Compute the logarithm base 10 of x. Return the “principal value” (for a description of this, see numpy.log10) of \(log_{10}(x)\). For real x > 0, this is a real number (log10(0) returns -inf and log10(np.inf) returns inf). Otherwise, the complex principle value is returned.  Parameters 
 
xarray_like or scalar


The value(s) whose log base 10 is (are) required.    Returns 
 
outndarray or scalar


The log base 10 of the x value(s). If x was a scalar, so is out, otherwise an array object is returned.      See also  numpy.log10
  Notes For a log10() that returns NAN when real x < 0, use numpy.log10 (note, however, that otherwise numpy.log10 and this log10 are identical, i.e., both return -inf for x = 0, inf for x = inf, and, notably, the complex principle value if x.imag != 0). Examples (We set the printing precision so the example can be auto-tested) >>> np.set_printoptions(precision=4)
 >>> np.emath.log10(10**1)
1.0
 >>> np.emath.log10([-10**1, -10**2, 10**2])
array([1.+1.3644j, 2.+1.3644j, 2.+0.j    ])
numpy.lib.scimath.log2   lib.scimath.log2(x)[source]
 
Compute the logarithm base 2 of x. Return the “principal value” (for a description of this, see numpy.log2) of \(log_2(x)\). For real x > 0, this is a real number (log2(0) returns -inf and log2(np.inf) returns inf). Otherwise, the complex principle value is returned.  Parameters 
 
xarray_like


The value(s) whose log base 2 is (are) required.    Returns 
 
outndarray or scalar


The log base 2 of the x value(s). If x was a scalar, so is out, otherwise an array is returned.      See also  numpy.log2
  Notes For a log2() that returns NAN when real x < 0, use numpy.log2 (note, however, that otherwise numpy.log2 and this log2 are identical, i.e., both return -inf for x = 0, inf for x = inf, and, notably, the complex principle value if x.imag != 0). Examples We set the printing precision so the example can be auto-tested: >>> np.set_printoptions(precision=4)
 >>> np.emath.log2(8)
3.0
>>> np.emath.log2([-4, -8, 8])
array([2.+4.5324j, 3.+4.5324j, 3.+0.j    ])
numpy.lib.scimath.logn   lib.scimath.logn(n, x)[source]
 
Take log base n of x. If x contains negative inputs, the answer is computed and returned in the complex domain.  Parameters 
 
narray_like


The integer base(s) in which the log is taken.  
xarray_like


The value(s) whose log base n is (are) required.    Returns 
 
outndarray or scalar


The log base n of the x value(s). If x was a scalar, so is out, otherwise an array is returned.     Examples >>> np.set_printoptions(precision=4)
 >>> np.emath.logn(2, [4, 8])
array([2., 3.])
>>> np.emath.logn(2, [-4, -8, 8])
array([2.+4.5324j, 3.+4.5324j, 3.+0.j    ])
numpy.lib.scimath.power   lib.scimath.power(x, p)[source]
 
Return x to the power p, (x**p). If x contains negative values, the output is converted to the complex domain.  Parameters 
 
xarray_like


The input value(s).  
parray_like of ints


The power(s) to which x is raised. If x contains multiple values, p has to either be a scalar, or contain the same number of values as x. In the latter case, the result is x[0]**p[0], x[1]**p[1], ....    Returns 
 
outndarray or scalar


The result of x**p. If x and p are scalars, so is out, otherwise an array is returned.      See also  numpy.power
  Examples >>> np.set_printoptions(precision=4)
 >>> np.emath.power([2, 4], 2)
array([ 4, 16])
>>> np.emath.power([2, 4], -2)
array([0.25  ,  0.0625])
>>> np.emath.power([-2, 4], 2)
array([ 4.-0.j, 16.+0.j])
numpy.lib.scimath.sqrt   lib.scimath.sqrt(x)[source]
 
Compute the square root of x. For negative input elements, a complex value is returned (unlike numpy.sqrt which returns NaN).  Parameters 
 
xarray_like


The input value(s).    Returns 
 
outndarray or scalar


The square root of x. If x was a scalar, so is out, otherwise an array is returned.      See also  numpy.sqrt
  Examples For real, non-negative inputs this works just like numpy.sqrt: >>> np.emath.sqrt(1)
1.0
>>> np.emath.sqrt([1, 4])
array([1.,  2.])
 But it automatically handles negative inputs: >>> np.emath.sqrt(-1)
1j
>>> np.emath.sqrt([-1,4])
array([0.+1.j, 2.+0.j])