doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
numpy.record.argsort method record.argsort() Scalar method identical to the corresponding array attribute. Please see ndarray.argsort.
numpy.reference.generated.numpy.record.argsort
numpy.record.astype method record.astype() Scalar method identical to the corresponding array attribute. Please see ndarray.astype.
numpy.reference.generated.numpy.record.astype
numpy.record.base attribute record.base base object
numpy.reference.generated.numpy.record.base
numpy.record.byteswap method record.byteswap() Scalar method identical to the corresponding array attribute. Please see ndarray.byteswap.
numpy.reference.generated.numpy.record.byteswap
numpy.record.choose method record.choose() Scalar method identical to the corresponding array attribute. Please see ndarray.choose.
numpy.reference.generated.numpy.record.choose
numpy.record.clip method record.clip() Scalar method identical to the corresponding array attribute. Please see ndarray.clip.
numpy.reference.generated.numpy.record.clip
numpy.record.compress method record.compress() Scalar method identical to the corresponding array attribute. Please see ndarray.compress.
numpy.reference.generated.numpy.record.compress
numpy.record.conjugate method record.conjugate() Scalar method identical to the corresponding array attribute. Please see ndarray.conjugate.
numpy.reference.generated.numpy.record.conjugate
numpy.record.copy method record.copy() Scalar method identical to the corresponding array attribute. Please see ndarray.copy.
numpy.reference.generated.numpy.record.copy
numpy.record.cumprod method record.cumprod() Scalar method identical to the corresponding array attribute. Please see ndarray.cumprod.
numpy.reference.generated.numpy.record.cumprod
numpy.record.cumsum method record.cumsum() Scalar method identical to the corresponding array attribute. Please see ndarray.cumsum.
numpy.reference.generated.numpy.record.cumsum
numpy.record.data attribute record.data Pointer to start of data.
numpy.reference.generated.numpy.record.data
numpy.record.diagonal method record.diagonal() Scalar method identical to the corresponding array attribute. Please see ndarray.diagonal.
numpy.reference.generated.numpy.record.diagonal
numpy.record.dump method record.dump() Scalar method identical to the corresponding array attribute. Please see ndarray.dump.
numpy.reference.generated.numpy.record.dump
numpy.record.dumps method record.dumps() Scalar method identical to the corresponding array attribute. Please see ndarray.dumps.
numpy.reference.generated.numpy.record.dumps
numpy.record.fill method record.fill() Scalar method identical to the corresponding array attribute. Please see ndarray.fill.
numpy.reference.generated.numpy.record.fill
numpy.record.flags attribute record.flags integer value of flags
numpy.reference.generated.numpy.record.flags
numpy.record.flat attribute record.flat A 1-D view of the scalar.
numpy.reference.generated.numpy.record.flat
numpy.record.flatten method record.flatten() Scalar method identical to the corresponding array attribute. Please see ndarray.flatten.
numpy.reference.generated.numpy.record.flatten
numpy.record.getfield method record.getfield() Scalar method identical to the corresponding array attribute. Please see ndarray.getfield.
numpy.reference.generated.numpy.record.getfield
numpy.record.item method record.item() Scalar method identical to the corresponding array attribute. Please see ndarray.item.
numpy.reference.generated.numpy.record.item
numpy.record.itemset method record.itemset() Scalar method identical to the corresponding array attribute. Please see ndarray.itemset.
numpy.reference.generated.numpy.record.itemset
numpy.record.itemsize attribute record.itemsize The length of one element in bytes.
numpy.reference.generated.numpy.record.itemsize
numpy.record.max method record.max() Scalar method identical to the corresponding array attribute. Please see ndarray.max.
numpy.reference.generated.numpy.record.max
numpy.record.mean method record.mean() Scalar method identical to the corresponding array attribute. Please see ndarray.mean.
numpy.reference.generated.numpy.record.mean
numpy.record.min method record.min() Scalar method identical to the corresponding array attribute. Please see ndarray.min.
numpy.reference.generated.numpy.record.min
numpy.record.nbytes attribute record.nbytes The length of the scalar in bytes.
numpy.reference.generated.numpy.record.nbytes
numpy.record.ndim attribute record.ndim The number of array dimensions.
numpy.reference.generated.numpy.record.ndim
numpy.record.newbyteorder method record.newbyteorder(new_order='S', /) Return a new dtype with a different byte order. Changes are also made in all fields and sub-arrays of the data type. The new_order code can be any from the following: ‘S’ - swap dtype from current to opposite endian {‘<’, ‘little’} - little end...
numpy.reference.generated.numpy.record.newbyteorder
numpy.record.nonzero method record.nonzero() Scalar method identical to the corresponding array attribute. Please see ndarray.nonzero.
numpy.reference.generated.numpy.record.nonzero
numpy.record.pprint method record.pprint()[source] Pretty-print all fields.
numpy.reference.generated.numpy.record.pprint
numpy.record.prod method record.prod() Scalar method identical to the corresponding array attribute. Please see ndarray.prod.
numpy.reference.generated.numpy.record.prod
numpy.record.ptp method record.ptp() Scalar method identical to the corresponding array attribute. Please see ndarray.ptp.
numpy.reference.generated.numpy.record.ptp
numpy.record.put method record.put() Scalar method identical to the corresponding array attribute. Please see ndarray.put.
numpy.reference.generated.numpy.record.put
numpy.record.ravel method record.ravel() Scalar method identical to the corresponding array attribute. Please see ndarray.ravel.
numpy.reference.generated.numpy.record.ravel
numpy.record.repeat method record.repeat() Scalar method identical to the corresponding array attribute. Please see ndarray.repeat.
numpy.reference.generated.numpy.record.repeat
numpy.record.reshape method record.reshape() Scalar method identical to the corresponding array attribute. Please see ndarray.reshape.
numpy.reference.generated.numpy.record.reshape
numpy.record.resize method record.resize() Scalar method identical to the corresponding array attribute. Please see ndarray.resize.
numpy.reference.generated.numpy.record.resize
numpy.record.round method record.round() Scalar method identical to the corresponding array attribute. Please see ndarray.round.
numpy.reference.generated.numpy.record.round
numpy.record.searchsorted method record.searchsorted() Scalar method identical to the corresponding array attribute. Please see ndarray.searchsorted.
numpy.reference.generated.numpy.record.searchsorted
numpy.record.setfield method record.setfield() Scalar method identical to the corresponding array attribute. Please see ndarray.setfield.
numpy.reference.generated.numpy.record.setfield
numpy.record.setflags method record.setflags() Scalar method identical to the corresponding array attribute. Please see ndarray.setflags.
numpy.reference.generated.numpy.record.setflags
numpy.record.size attribute record.size The number of elements in the gentype.
numpy.reference.generated.numpy.record.size
numpy.record.sort method record.sort() Scalar method identical to the corresponding array attribute. Please see ndarray.sort.
numpy.reference.generated.numpy.record.sort
numpy.record.squeeze method record.squeeze() Scalar method identical to the corresponding array attribute. Please see ndarray.squeeze.
numpy.reference.generated.numpy.record.squeeze
numpy.record.std method record.std() Scalar method identical to the corresponding array attribute. Please see ndarray.std.
numpy.reference.generated.numpy.record.std
numpy.record.strides attribute record.strides Tuple of bytes steps in each dimension.
numpy.reference.generated.numpy.record.strides
numpy.record.sum method record.sum() Scalar method identical to the corresponding array attribute. Please see ndarray.sum.
numpy.reference.generated.numpy.record.sum
numpy.record.swapaxes method record.swapaxes() Scalar method identical to the corresponding array attribute. Please see ndarray.swapaxes.
numpy.reference.generated.numpy.record.swapaxes
numpy.record.T attribute record.T Scalar attribute identical to the corresponding array attribute. Please see ndarray.T.
numpy.reference.generated.numpy.record.t
numpy.record.take method record.take() Scalar method identical to the corresponding array attribute. Please see ndarray.take.
numpy.reference.generated.numpy.record.take
numpy.record.tofile method record.tofile() Scalar method identical to the corresponding array attribute. Please see ndarray.tofile.
numpy.reference.generated.numpy.record.tofile
numpy.record.tolist method record.tolist() Scalar method identical to the corresponding array attribute. Please see ndarray.tolist.
numpy.reference.generated.numpy.record.tolist
numpy.record.tostring method record.tostring() Scalar method identical to the corresponding array attribute. Please see ndarray.tostring.
numpy.reference.generated.numpy.record.tostring
numpy.record.trace method record.trace() Scalar method identical to the corresponding array attribute. Please see ndarray.trace.
numpy.reference.generated.numpy.record.trace
numpy.record.transpose method record.transpose() Scalar method identical to the corresponding array attribute. Please see ndarray.transpose.
numpy.reference.generated.numpy.record.transpose
numpy.record.var method record.var() Scalar method identical to the corresponding array attribute. Please see ndarray.var.
numpy.reference.generated.numpy.record.var
numpy.record.view method record.view() Scalar method identical to the corresponding array attribute. Please see ndarray.view.
numpy.reference.generated.numpy.record.view
NumPy Reference Release 1.22 Date December 31, 2021 This reference manual details functions, modules, and objects included in NumPy, describing what they are and what they do. For learning how to use NumPy, see the complete documentation. Array objects The N-dimensional array (ndarray) Scalars Data type objects...
numpy.reference.index
Routines In this chapter routine docstrings are presented, grouped by functionality. Many docstrings contain example code, which demonstrates basic usage of the routine. The examples assume that NumPy is imported with: >>> import numpy as np A convenient way to execute examples is the %doctest_mode mode of IPython, wh...
numpy.reference.routines
Testing the numpy.i Typemaps Introduction Writing tests for the numpy.i SWIG interface file is a combinatorial headache. At present, 12 different data types are supported, each with 74 different argument signatures, for a total of 888 typemaps supported “out of the box”. Each of these typemaps, in turn, might require ...
numpy.reference.swig.testing
setup.py #!/usr/bin/env python3 """ Build the Cython demonstrations of low-level access to NumPy random Usage: python setup.py build_ext -i """ import setuptools # triggers monkeypatching distutils from distutils.core import setup from os.path import dirname, join, abspath import numpy as np from Cython.Build import...
numpy.reference.random.examples.cython.setup.py
Statistics Order statistics ptp(a[, axis, out, keepdims]) Range of values (maximum - minimum) along an axis. percentile(a, q[, axis, out, ...]) Compute the q-th percentile of the data along the specified axis. nanpercentile(a, q[, axis, out, ...]) Compute the qth percentile of the data along the specified axis, ...
numpy.reference.routines.statistics
numpy.testing.assert_allclose testing.assert_allclose(actual, desired, rtol=1e-07, atol=0, equal_nan=True, err_msg='', verbose=True)[source] Raises an AssertionError if two objects are not equal up to desired tolerance. The test is equivalent to allclose(actual, desired, rtol, atol) (note that allclose has differen...
numpy.reference.generated.numpy.testing.assert_allclose
numpy.testing.assert_almost_equal testing.assert_almost_equal(actual, desired, decimal=7, err_msg='', verbose=True)[source] Raises an AssertionError if two items are not equal up to desired precision. Note It is recommended to use one of assert_allclose, assert_array_almost_equal_nulp or assert_array_max_ulp inste...
numpy.reference.generated.numpy.testing.assert_almost_equal
numpy.testing.assert_approx_equal testing.assert_approx_equal(actual, desired, significant=7, err_msg='', verbose=True)[source] Raises an AssertionError if two items are not equal up to significant digits. Note It is recommended to use one of assert_allclose, assert_array_almost_equal_nulp or assert_array_max_ulp ...
numpy.reference.generated.numpy.testing.assert_approx_equal
numpy.testing.assert_array_almost_equal testing.assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True)[source] Raises an AssertionError if two objects are not equal up to desired precision. Note It is recommended to use one of assert_allclose, assert_array_almost_equal_nulp or assert_array_max_ulp in...
numpy.reference.generated.numpy.testing.assert_array_almost_equal
numpy.testing.assert_array_almost_equal_nulp testing.assert_array_almost_equal_nulp(x, y, nulp=1)[source] Compare two arrays relatively to their spacing. This is a relatively robust method to compare two arrays whose amplitude is variable. Parameters x, yarray_like Input arrays. nulpint, optional The maxi...
numpy.reference.generated.numpy.testing.assert_array_almost_equal_nulp
numpy.testing.assert_array_equal testing.assert_array_equal(x, y, err_msg='', verbose=True)[source] Raises an AssertionError if two array_like objects are not equal. Given two array_like objects, check that the shape is equal and all elements of these objects are equal (but see the Notes for the special handling of...
numpy.reference.generated.numpy.testing.assert_array_equal
numpy.testing.assert_array_less testing.assert_array_less(x, y, err_msg='', verbose=True)[source] Raises an AssertionError if two array_like objects are not ordered by less than. Given two array_like objects, check that the shape is equal and all elements of the first object are strictly smaller than those of the s...
numpy.reference.generated.numpy.testing.assert_array_less
numpy.testing.assert_array_max_ulp testing.assert_array_max_ulp(a, b, maxulp=1, dtype=None)[source] Check that all items of arrays differ in at most N Units in the Last Place. Parameters a, barray_like Input arrays to be compared. maxulpint, optional The maximum number of units in the last place that elem...
numpy.reference.generated.numpy.testing.assert_array_max_ulp
numpy.testing.assert_equal testing.assert_equal(actual, desired, err_msg='', verbose=True)[source] Raises an AssertionError if two objects are not equal. Given two objects (scalars, lists, tuples, dictionaries or numpy arrays), check that all elements of these objects are equal. An exception is raised at the first ...
numpy.reference.generated.numpy.testing.assert_equal
numpy.testing.assert_raises testing.assert_raises(exception_class, callable, *args, **kwargs) assert_raises(exception_class)[source] testing.assert_raises(exception_class) → None Fail unless an exception of class exception_class is thrown by callable when invoked with arguments args and keyword arguments kwargs. ...
numpy.reference.generated.numpy.testing.assert_raises
numpy.testing.assert_raises_regex testing.assert_raises_regex(exception_class, expected_regexp, callable, *args, **kwargs) assert_raises_regex(exception_class, expected_regexp)[source] Fail unless an exception of class exception_class and with message that matches expected_regexp is thrown by callable when invoked ...
numpy.reference.generated.numpy.testing.assert_raises_regex
numpy.testing.assert_string_equal testing.assert_string_equal(actual, desired)[source] Test if two strings are equal. If the given strings are equal, assert_string_equal does nothing. If they are not equal, an AssertionError is raised, and the diff between the strings is shown. Parameters actualstr The string...
numpy.reference.generated.numpy.testing.assert_string_equal
numpy.testing.assert_warns testing.assert_warns(warning_class, *args, **kwargs)[source] Fail unless the given callable throws the specified warning. A warning of class warning_class should be thrown by the callable when invoked with arguments args and keyword arguments kwargs. If a different type of warning is thro...
numpy.reference.generated.numpy.testing.assert_warns
numpy.testing.dec.deprecated testing.dec.deprecated(conditional=True)[source] Deprecated since version 1.21: This decorator is retained for compatibility with the nose testing framework, which is being phased out. Please use the nose2 or pytest frameworks instead. Filter deprecation warnings while running the tes...
numpy.reference.generated.numpy.testing.dec.deprecated
numpy.testing.dec.knownfailureif testing.dec.knownfailureif(fail_condition, msg=None)[source] Deprecated since version 1.21: This decorator is retained for compatibility with the nose testing framework, which is being phased out. Please use the nose2 or pytest frameworks instead. Make function raise KnownFailureE...
numpy.reference.generated.numpy.testing.dec.knownfailureif
numpy.testing.dec.setastest testing.dec.setastest(tf=True)[source] Deprecated since version 1.21: This decorator is retained for compatibility with the nose testing framework, which is being phased out. Please use the nose2 or pytest frameworks instead. Signals to nose that this function is or is not a test. Par...
numpy.reference.generated.numpy.testing.dec.setastest
numpy.testing.dec.skipif testing.dec.skipif(skip_condition, msg=None)[source] Deprecated since version 1.21: This decorator is retained for compatibility with the nose testing framework, which is being phased out. Please use the nose2 or pytest frameworks instead. Make function raise SkipTest exception if a given...
numpy.reference.generated.numpy.testing.dec.skipif
numpy.testing.dec.slow testing.dec.slow(t)[source] Deprecated since version 1.21: This decorator is retained for compatibility with the nose testing framework, which is being phased out. Please use the nose2 or pytest frameworks instead. Label a test as ‘slow’. The exact definition of a slow test is obviously bot...
numpy.reference.generated.numpy.testing.dec.slow
numpy.testing.decorate_methods testing.decorate_methods(cls, decorator, testmatch=None)[source] Apply a decorator to all methods in a class matching a regular expression. The given decorator is applied to all public methods of cls that are matched by the regular expression testmatch (testmatch.search(methodname)). ...
numpy.reference.generated.numpy.testing.decorate_methods
numpy.testing.run_module_suite testing.run_module_suite(file_to_run=None, argv=None)[source] Run a test module. Equivalent to calling $ nosetests <argv> <file_to_run> from the command line Parameters file_to_runstr, optional Path to test module, or None. By default, run the module from which this function is ...
numpy.reference.generated.numpy.testing.run_module_suite
numpy.testing.rundocs testing.rundocs(filename=None, raise_on_error=True)[source] Run doctests found in the given file. By default rundocs raises an AssertionError on failure. Parameters filenamestr The path to the file for which the doctests are run. raise_on_errorbool Whether to raise an AssertionError ...
numpy.reference.generated.numpy.testing.rundocs
numpy.testing.suppress_warnings.__call__ method testing.suppress_warnings.__call__(func)[source] Function decorator to apply certain suppressions to a whole function.
numpy.reference.generated.numpy.testing.suppress_warnings.__call__
numpy.testing.suppress_warnings.filter method testing.suppress_warnings.filter(category=<class 'Warning'>, message='', module=None)[source] Add a new suppressing filter or apply it if the state is entered. Parameters categoryclass, optional Warning class to filter messagestring, optional Regular expressio...
numpy.reference.generated.numpy.testing.suppress_warnings.filter
numpy.testing.suppress_warnings.record method testing.suppress_warnings.record(category=<class 'Warning'>, message='', module=None)[source] Append a new recording filter or apply it if the state is entered. All warnings matching will be appended to the log attribute. Parameters categoryclass, optional Warning...
numpy.reference.generated.numpy.testing.suppress_warnings.record
numpy.ufunc.__call__ method ufunc.__call__(*args, **kwargs) Call self as a function.
numpy.reference.generated.numpy.ufunc.__call__
numpy.ufunc.accumulate method ufunc.accumulate(array, axis=0, dtype=None, out=None) Accumulate the result of applying the operator to all elements. For a one-dimensional array, accumulate produces results equivalent to: r = np.empty(len(A)) t = op.identity # op = the ufunc being applied to A's elements for ...
numpy.reference.generated.numpy.ufunc.accumulate
numpy.ufunc.at method ufunc.at(a, indices, b=None, /) Performs unbuffered in place operation on operand ‘a’ for elements specified by ‘indices’. For addition ufunc, this method is equivalent to a[indices] += b, except that results are accumulated for elements that are indexed more than once. For example, a[[0,0]] +...
numpy.reference.generated.numpy.ufunc.at
numpy.ufunc.identity attribute ufunc.identity The identity value. Data attribute containing the identity element for the ufunc, if it has one. If it does not, the attribute value is None. Examples >>> np.add.identity 0 >>> np.multiply.identity 1 >>> np.power.identity 1 >>> print(np.exp.identity) None
numpy.reference.generated.numpy.ufunc.identity
numpy.ufunc.nargs attribute ufunc.nargs The number of arguments. Data attribute containing the number of arguments the ufunc takes, including optional ones. Notes Typically this value will be one more than what you might expect because all ufuncs take the optional “out” argument. Examples >>> np.add.nargs 3 >>> np....
numpy.reference.generated.numpy.ufunc.nargs
numpy.ufunc.nin attribute ufunc.nin The number of inputs. Data attribute containing the number of arguments the ufunc treats as input. Examples >>> np.add.nin 2 >>> np.multiply.nin 2 >>> np.power.nin 2 >>> np.exp.nin 1
numpy.reference.generated.numpy.ufunc.nin
numpy.ufunc.nout attribute ufunc.nout The number of outputs. Data attribute containing the number of arguments the ufunc treats as output. Notes Since all ufuncs can take output arguments, this will always be (at least) 1. Examples >>> np.add.nout 1 >>> np.multiply.nout 1 >>> np.power.nout 1 >>> np.exp.nout 1
numpy.reference.generated.numpy.ufunc.nout
numpy.ufunc.ntypes attribute ufunc.ntypes The number of types. The number of numerical NumPy types - of which there are 18 total - on which the ufunc can operate. See also numpy.ufunc.types Examples >>> np.add.ntypes 18 >>> np.multiply.ntypes 18 >>> np.power.ntypes 17 >>> np.exp.ntypes 7 >>> np.remainder.ntypes...
numpy.reference.generated.numpy.ufunc.ntypes
numpy.ufunc.outer method ufunc.outer(A, B, /, **kwargs) Apply the ufunc op to all pairs (a, b) with a in A and b in B. Let M = A.ndim, N = B.ndim. Then the result, C, of op.outer(A, B) is an array of dimension M + N such that: \[C[i_0, ..., i_{M-1}, j_0, ..., j_{N-1}] = op(A[i_0, ..., i_{M-1}], B[j_0, ..., j_{N-1}...
numpy.reference.generated.numpy.ufunc.outer
numpy.ufunc.reduce method ufunc.reduce(array, axis=0, dtype=None, out=None, keepdims=False, initial=<no value>, where=True) Reduces array’s dimension by one, by applying ufunc along one axis. Let \(array.shape = (N_0, ..., N_i, ..., N_{M-1})\). Then \(ufunc.reduce(array, axis=i)[k_0, ..,k_{i-1}, k_{i+1}, .., k_{M-1...
numpy.reference.generated.numpy.ufunc.reduce
numpy.ufunc.reduceat method ufunc.reduceat(array, indices, axis=0, dtype=None, out=None) Performs a (local) reduce with specified slices over a single axis. For i in range(len(indices)), reduceat computes ufunc.reduce(array[indices[i]:indices[i+1]]), which becomes the i-th generalized “row” parallel to axis in the ...
numpy.reference.generated.numpy.ufunc.reduceat
numpy.ufunc.signature attribute ufunc.signature Definition of the core elements a generalized ufunc operates on. The signature determines how the dimensions of each input/output array are split into core and loop dimensions: Each dimension in the signature is matched to a dimension of the corresponding passed-in a...
numpy.reference.generated.numpy.ufunc.signature
numpy.ufunc.types attribute ufunc.types Returns a list with types grouped input->output. Data attribute listing the data-type “Domain-Range” groupings the ufunc can deliver. The data-types are given using the character codes. See also numpy.ufunc.ntypes Examples >>> np.add.types ['??->?', 'bb->b', 'BB->B', 'hh-...
numpy.reference.generated.numpy.ufunc.types