Search
Search Results
Search finished, found 102 page(s) matching the search query.
- numpy.matrix.data
...numpy.matrix.data...
- numpy.matrix.data (Python attribute, in numpy.matrix.data)
- Array API
...ity must take precedence over public relations, for Nature cannot be fooled. — Richard P. Feynman Array structure and data access These macros access the PyArrayObject structure members and are defined in ndarraytypes.h. The input argumen...
- Array creation
...f the elements in the array, which can be specified explicitly. This feature gives you more control over the underlying data structures and how the elements are handled in C/C++ functions. When values do not fit and you are using a dtype, N...
- Array creation routines
...fill_value[, dtype, order, ...]) Return a full array with the same shape and type as a given array. From existing data array(object[, dtype, copy, order, subok, ...]) Create an array. asarray(a[, dtype, order, device, copy, like])...
- Array iterator API
...ufuncs, allowing user code to support features like output parameters, preservation of memory layouts, and buffering of data with the wrong alignment or type, without requiring difficult coding. This page documents the API for the iterator....
- Constants of the
numpy.ma
module...module defines several constants. numpy.ma.masked The masked constant is a special case of MaskedArray, with a float datatype and a null shape. It is used to test whether a specific entry of a masked array is masked, or to mask one or se...
- How to contribute to the NumPy documentation
...me up with a rough draft. Open source is a community effort. Do your best – we’ll help fix issues. Images and real-life data make text more engaging and powerful, but be sure what you use is appropriately licensed and available. Here again,...
- Internal organization of NumPy arrays
...equested to refer to Travis Oliphant’s book Guide to NumPy. NumPy arrays consist of two major components: the raw array data (from now on, referred to as the data buffer), and the information about the raw array data. The data buffer is typ...
- NumPy 1.10.0 Release Notes
...can now be used with periodic functions np.interp now has a new parameter period that supplies the period of the input data xp. In such case, the input data is properly normalized to the given period and one end point is added to each extr...
- NumPy 1.11.0 Release Notes
...s a dtype type of different size causing the first dimension to change. Slicing a MaskedArray will return views of both data and mask. Currently the mask is copy-on-write and changes to the mask in the slice do not propagate to the original...
- NumPy 1.13.0 Release Notes
...ng numpy.unique. The original behaviour is recovered if axis=None (default). np.gradient now supports unevenly spaced data Users can now specify a not-constant spacing for data. In particular np.gradient can now take: A single scalar to...
- NumPy 1.14.0 Release Notes
...strings and – after encoding them as either utf-8 (python 3) or the default encoding (python 2) – treats them as binary data. If reading binary data is desired, np.frombuffer should be used directly. The style option of array2string is depr...
- NumPy 1.15.0 Release Notes
...l accept NaN values when explicit bins are given Previously it would fail when trying to compute a finite range for the data. Since the range is ignored anyway when the bins are given explicitly, this error was needless. Note that calling h...
- NumPy 1.16.0 Release Notes
...addition of: PyUFuncObject.core_dim_flags PyUFuncObject.core_dim_sizes PyUFuncObject.identity_value PyUFunc_FromFuncAndDataAndSignatureAndIdentity New Features Integrated squared error (ISE) estimator added to histogram This method (bi...
- NumPy 1.20.0 Release Notes
...he deprecation warning. The third column lists alternative NumPy names which may occasionally be preferential. See also Data types for additional details. Deprecated name Identical to NumPy scalar type names numpy.bool bool numpy.bool_...
- NumPy 1.25.0 Release Notes
...output dtype using the dtype kwarg can make the operation succeed, but we do not recommend it. (gh-22707) When loading data from a file handle using np.load, if the handle is at the end of file, as can happen when reading multiple arrays b...
- NumPy 1.8.0 Release Notes
...for how to access the content. The hash function of numpy.void scalars has been changed. Previously the pointer to the data was hashed as an integer. Now, the hash function uses the tuple-hash algorithm to combine the hash functions of th...
- NumPy 1.9.0 Release Notes
...nient broadcasting to arrays of the original shape. Dtype parameter added to np.linspace and np.logspace The returned data type from the linspace and logspace functions can now be specified using the dtype parameter. More general np.tri...
- NumPy 2.0.0 Release Notes
...vior was changed by adopting NEP 50. This fixes many user surprises about promotions which previously often depended on data values of input arrays rather than only their dtypes. Please see the NEP and the NumPy 2.0 migration guide for det...
- NumPy 2.1.0 Release Notes
...extension as compatible. (gh-26981) Improvements histogram auto-binning now returns bin sizes >=1 for integer input data For integer input data, bin sizes smaller than 1 result in spurious empty bins. This is now avoided when the numbe...
- NumPy 2.2.0 Release Notes
.... Thus should generally improve performance. (gh-27808) Changes numpy.fix now won’t perform casting to a floating data-type for integer and boolean data-type input arrays. (gh-26766) The type annotations of numpy.float64 and numpy.co...
- NumPy for MATLAB users
...info(float).eps or np.spacing(1) distance from 1 to the next larger representable real number in double precision load data.mat io.loadmat('data.mat') Load MATLAB variables saved to the file data.mat. (Note: When saving arrays to data.mat...
- NumPy quickstart
...ize 8 (=64/8), while one of type complex32 has itemsize 4 (=32/8). It is equivalent to ndarray.dtype.itemsize. ndarray.datathe buffer containing the actual elements of the array. Normally, we won’t need to use this attribute because we wil...
- numpy.array
...s an array, or any (nested) sequence. If object is a scalar, a 0-dimensional array containing object is returned. dtypedata-type, optionalThe desired data-type for the array. If not given, NumPy will try to use a default dtype that can rep...
- numpy.asmatrix
...numpy.asmatrix numpy.asmatrix(data, dtype=None)[source] Interpret the input as a matrix. Unlike matrix, asmatrix does not make a copy if the input is...
- numpy.average
...ms=<no value>)[source] Compute the weighted average along the specified axis. Parameters: aarray_likeArray containing data to be averaged. If a is not an array, a conversion is attempted. axisNone or int or tuple of ints, optionalAxis or...
- numpy.bmat
...t=None)[source] Build a matrix object from a string, nested sequence, or array. Parameters: objstr or array_likeInput data. If a string, variables in the current scope may be referenced by name. ldictdict, optionalA dictionary that repla...
- numpy.char.chararray
...Default is False. bufferobject exposing the buffer interface or str, optionalMemory address of the start of the array data. Default is None, in which case a new array is created. offsetint, optionalFixed stride displacement from the beg...
- numpy.char.chararray.view
...numpy.char.chararray.view method char.chararray.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parameter, since the former invokes dtype(None) which...
- numpy.corrcoef
...cated since version 1.10.0. ddof_NoValue, optionalHas no effect, do not use. Deprecated since version 1.10.0. dtypedata-type, optionalData-type of the result. By default, the return data-type will have at least numpy.float64 precision....
- numpy.cov
...r=True, bias=False, ddof=None, fweights=None, aweights=None, *, dtype=None)[source] Estimate a covariance matrix, given data and weights. Covariance indicates the level to which two variables vary together. If we examine N-dimensional sampl...
- numpy.einsum
...ese are the arrays for the operation. outndarray, optionalIf provided, the calculation is done into this array. dtype{data-type, None}, optionalIf provided, forces the calculation to use the data type specified. Note that you may have to...
- numpy.linalg.diagonal
...imensions and appending a dimension equal to the size of the resulting diagonals. The returned array must have the same data type as x. See also numpy.diagonal Examples >>> a = np.arange(4).reshape(2, 2); a array([[0, 1], [2,...
- numpy.linalg.lstsq
...If b is a matrix, then all array results are returned as matrices. Examples Fit a line, y = mx + c, through some noisy data-points: >>> import numpy as np >>> x = np.array([0, 1, 2, 3]) >>> y = np.array([-1, 0.2, 0.9, 2.1]) By examining...
- numpy.linalg.matrix_rank
...ues are considered zero. If tol is None, and S is an array with singular values for M, and eps is the epsilon value for datatype of S, then tol is set to S.max() * max(M, N) * eps. hermitianbool, optionalIf True, A is assumed to be Hermiti...
- numpy.linalg.multi_dot
...xamples multi_dot allows you to write: >>> import numpy as np >>> from numpy.linalg import multi_dot >>> # Prepare some data >>> A = np.random.random((10000, 100)) >>> B = np.random.random((100, 1000)) >>> C = np.random.random((1000, 5)) >>...
- numpy.linalg.qr
...use of qr: solving of least squares problems What are the least-squares-best m and y0 in y = y0 + mx for the following data: {(0,1), (1,0), (1,2), (2,1)}. (Graph the points and you’ll see that it should be y0 = 0, m = 1.) The answer is pr...
- numpy.linalg.svdvals
...whose last two dimensions form matrices on which to perform singular value decomposition. Should have a floating-point data type. Returns: outndarrayAn array with shape (…, K) that contains the vector(s) of singular values of length K,...
- numpy.linalg.trace
...t > 0: off-diagonal above the main diagonal. * offset < 0: off-diagonal below the main diagonal. dtypedtype, optionalData type of the returned array. Returns: outndarrayAn array containing the traces and whose shape is determined by...
- numpy.ma.average
...lse, *, keepdims=<no value>)[source] Return the weighted average of array over the given axis. Parameters: aarray_likeData to be averaged. Masked entries are not taken into account in the computation. axisNone or int or tuple of ints, op...
- numpy.ma.corrcoef
...ue, ddof=<no value>)[source] Return Pearson product-moment correlation coefficients. Except for the handling of missing data this function does the same as numpy.corrcoef. For more details and examples, see numpy.corrcoef. Parameters: xar...
- numpy.ma.cov
...e, bias=False, allow_masked=True, ddof=None)[source] Estimate the covariance matrix. Except for the handling of missing data this function does the same as numpy.cov. For more details and examples, see numpy.cov. By default, masked values a...
- numpy.ma.masked_array.data
...numpy.ma.masked_array.data...
- numpy.ma.polyfit
...ates of the M sample points (x[i], y[i]). yarray_like, shape (M,) or (M, K)y-coordinates of the sample points. Several data sets of sample points sharing the same x-coordinates can be fitted at once by passing in a 2D-array that contains o...
- numpy.matlib.empty
...en shape and type, without initializing entries. Parameters: shapeint or tuple of intShape of the empty matrix. dtypedata-type, optionalDesired output data-type. order{‘C’, ‘F’}, optionalWhether to store multi-dimensional data in row-ma...
- numpy.matlib.eye
...diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal. dtypedtype, optionalData-type of the returned matrix. order{‘C’, ‘F’}, optionalWhether the output should be stored in row-major (C-style) o...
- numpy.matlib.identity
...source] Returns the square identity matrix of given size. Parameters: nintSize of the returned identity matrix. dtypedata-type, optionalData-type of the output. Defaults to float. Returns: outmatrixn x n matrix with its main diagonal...
- numpy.matlib.ones
...a matrix of given shape and type, filled with ones. Parameters: shape{sequence of ints, int}Shape of the matrix dtypedata-type, optionalThe desired data-type for the matrix, default is np.float64. order{‘C’, ‘F’}, optionalWhether to sto...
- numpy.matlib.randn
...numpy.matlib.randn matlib.randn(*args)[source] Return a random matrix with data from the “standard normal” distribution. randn generates a matrix filled with random floats sampled from a univaria...
- numpy.matlib.zeros
...matrix of given shape and type, filled with zeros. Parameters: shapeint or sequence of intsShape of the matrix dtypedata-type, optionalThe desired data-type for the matrix, default is float. order{‘C’, ‘F’}, optionalWhether to store th...
- numpy.matrix
...numpy.matrix class numpy.matrix(data, dtype=None, copy=True)[source] Returns a matrix from an array-like object, or from a string of data. A matrix is a...
- numpy.matrix.astype
...unsafe', subok=True, copy=True) Copy of the array, cast to a specified type. Parameters: dtypestr or dtypeTypecode or data-type to which the array is cast. order{‘C’, ‘F’, ‘A’, ‘K’}, optionalControls the memory layout order of the result...
- numpy.matrix.byteswap
...p method matrix.byteswap(inplace=False) Swap the bytes of the array elements Toggle between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place. Arrays of byte-strings are not swappe...
- numpy.matrix.ctypes
...es it easier to use arrays when calling shared libraries with the ctypes module. The returned object has, among others, data, shape, and strides attributes (see Notes below) which themselves return ctypes objects that can be used as argumen...
- numpy.matrix.data
...numpy.matrix.data...
- numpy.matrix.dtype
...numpy.matrix.dtype attribute matrix.dtype Data-type of the array’s elements. Warning Setting arr.dtype is discouraged and may be deprecated in the future. Setti...
- numpy.matrix.flags
...The array flags cannot be set arbitrarily: WRITEBACKIFCOPY can only be set False. ALIGNED can only be set True if the data is truly aligned. WRITEABLE can only be set True if the array owns its own memory or the ultimate owner of the memo...
- numpy.matrix.getfield
...matrix.getfield(dtype, offset=0) Returns a field of the given array as a certain type. A field is a view of the array data with a given data-type. The values in the view are determined by the given type and the offset into the current arr...
- numpy.matrix.item
...tandard Python scalar objectA copy of the specified element of the array as a suitable Python scalar Notes When the data type of a is longdouble or clongdouble, item() returns a scalar array object because there is no available Python s...
- numpy.matrix.ravel
...ry, C-like order otherwise. ‘K’ means to read the elements in the order they occur in memory, except for reversing the data when strides are negative. By default, ‘C’ index order is used. Returns: retmatrixReturn the matrix flattened t...
- numpy.matrix.reshape
...numpy.matrix.reshape method matrix.reshape(shape, /, *, order='C', copy=None) Returns an array containing the same data with a new shape. Refer to numpy.reshape for full documentation. See also numpy.reshapeequivalent function Not...
- numpy.matrix.resize
...reference count will not be checked. Default is True. Returns: None Raises: ValueErrorIf 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 m...
- numpy.matrix.setfield
...trix.setfield method matrix.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: valobjectV...
- numpy.matrix.setflags
...ffect 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 flag can never be set to True. The flag WRITEABLE ca...
- numpy.matrix.strides
...y be deprecated in the future. numpy.lib.stride_tricks.as_strided should be preferred to create a new view of the same data in a safer way. See also numpy.lib.stride_tricks.as_strided Notes Imagine an array of 32-bit integers (each 4...
- numpy.matrix.tobytes
...numpy.matrix.tobytes method matrix.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...
- numpy.matrix.tofile
...numpy.matrix.tofile method matrix.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 us...
- numpy.matrix.transpose
...array.TArray property returning the array transposed. ndarray.reshapeGive a new shape to an array without changing its data. Examples >>> import numpy as np >>> a = np.array([[1, 2], [3, 4]]) >>> a array([[1, 2], [3, 4]]) >>> a.t...
- numpy.matrix.view
...numpy.matrix.view method matrix.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parameter, since the former invokes dtype(None) which...
- numpy.memmap.view
...numpy.memmap.view method memmap.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parameter, since the former invokes dtype(None) which...
- numpy.ndarray.view
...numpy.ndarray.view method ndarray.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parameter, since the former invokes dtype(None) which...
- numpy.polyfit
...ates of the M sample points (x[i], y[i]). yarray_like, shape (M,) or (M, K)y-coordinates of the sample points. Several data sets of sample points sharing the same x-coordinates can be fitted at once by passing in a 2D-array that contains o...
- numpy.polynomial.chebyshev.chebfit
...olynomial.chebyshev.chebfit(x, y, deg, rcond=None, full=False, w=None)[source] Least squares fit of Chebyshev series to data. Return the coefficients of a Chebyshev series of degree deg that is the least squares fit to the data values y giv...
- numpy.polynomial.chebyshev.Chebyshev.fit
...yshev.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x')[source] Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned inst...
- numpy.polynomial.hermite.hermfit
...polynomial.hermite.hermfit(x, y, deg, rcond=None, full=False, w=None)[source] Least squares fit of Hermite series to data. Return the coefficients of a Hermite series of degree deg that is the least squares fit to the data values y given...
- numpy.polynomial.hermite.Hermite.fit
...rmite.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x')[source] Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned inst...
- numpy.polynomial.hermite_e.hermefit
...polynomial.hermite_e.hermefit(x, y, deg, rcond=None, full=False, w=None)[source] Least squares fit of Hermite series to data. Return the coefficients of a HermiteE series of degree deg that is the least squares fit to the data values y give...
- numpy.polynomial.hermite_e.HermiteE.fit
...miteE.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x')[source] Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned inst...
- numpy.polynomial.laguerre.lagfit
...polynomial.laguerre.lagfit(x, y, deg, rcond=None, full=False, w=None)[source] Least squares fit of Laguerre series to data. Return the coefficients of a Laguerre series of degree deg that is the least squares fit to the data values y give...
- numpy.polynomial.laguerre.Laguerre.fit
...uerre.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x')[source] Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned inst...
- numpy.polynomial.legendre.Legendre.fit
...endre.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x')[source] Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned inst...
- numpy.polynomial.legendre.legfit
...polynomial.legendre.legfit(x, y, deg, rcond=None, full=False, w=None)[source] Least squares fit of Legendre series to data. Return the coefficients of a Legendre series of degree deg that is the least squares fit to the data values y give...
- numpy.polynomial.polynomial.polyfit
...polynomial.polynomial.polyfit(x, y, deg, rcond=None, full=False, w=None)[source] Least-squares fit of a polynomial to data. Return the coefficients of a polynomial of degree deg that is the least squares fit to the data values y given at...
- numpy.polynomial.polynomial.Polynomial.fit
...omial.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x')[source] Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned inst...
- numpy.random.Generator.multivariate_normal
...tive elements, and only on the diagonal) This geometrical property can be seen in two dimensions by plotting generated data-points: >>> mean = [0, 0] >>> cov = [[1, 0], [0, 100]] # diagonal covariance Diagonal covariance means that poin...
- numpy.random.multivariate_normal
...tive elements, and only on the diagonal) This geometrical property can be seen in two dimensions by plotting generated data-points: >>> mean = [0, 0] >>> cov = [[1, 0], [0, 100]] # diagonal covariance Diagonal covariance means that poin...
- numpy.random.RandomState.multivariate_normal
...tive elements, and only on the diagonal) This geometrical property can be seen in two dimensions by plotting generated data-points: >>> mean = [0, 0] >>> cov = [[1, 0], [0, 100]] # diagonal covariance Diagonal covariance means that poin...
- numpy.ravel
...ry, C-like order otherwise. ‘K’ means to read the elements in the order they occur in memory, except for reversing the data when strides are negative. By default, ‘C’ index order is used. Returns: yarray_likey is a contiguous 1-D arra...
- numpy.recarray
...ne, aligned=False, order='C')[source] Construct an ndarray that allows field access using attributes. Arrays may have a data-types containing fields, analogous to columns in a spread sheet. An example is [(x, int), (y, float)], where each...
- numpy.recarray.view
...numpy.recarray.view method recarray.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parameter, since the former invokes dtype(None) which...
- numpy.vectorize
...successive tuples of the input arrays like the python map function, except it uses the broadcasting rules of numpy. The data type of the output of vectorized is determined by calling the function with the first element of the input. This c...
- NumPy: the absolute basics for beginners
- Standard array subclasses
- 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...
- The N-dimensional array (
ndarray
)...n-negative integers that specify the sizes of each dimension. The type of items in the array is specified by a separate data-type object (dtype), one of which is associated with each ndarray. As with other container objects in Python, the c...
- Array objects
...cks are interpreted in exactly the same way. How each item in the array is to be interpreted is specified by a separate data-type object, one of which is associated with every array. In addition to basic types (integers, floats, etc.), the...
- Compatibility policy
- Generalized universal function API
- Glossary
- Universal functions (
ufunc
) - Using Python as glue