doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
numpy.ma.prod ma.prod(self, axis=None, dtype=None, out=None, keepdims=<no value>) = <numpy.ma.core._frommethod object>
Return the product of the array elements over the given axis. Masked elements are set to 1 internally for computation. Refer to numpy.prod for full documentation. See also numpy.ndarray.prod
cor... | numpy.reference.generated.numpy.ma.prod |
numpy.ma.ptp ma.ptp(obj, axis=None, out=None, fill_value=None, keepdims=<no value>)[source]
Return (maximum - minimum) along the given dimension (i.e. peak-to-peak value). Warning ptp preserves the data type of the array. This means the return value for an input of signed integers with n bits (e.g. np.int8, np.int... | numpy.reference.generated.numpy.ma.ptp |
numpy.ma.ravel ma.ravel(self, order='C') = <numpy.ma.core._frommethod object>
Returns a 1D version of self, as a view. Parameters
order{‘C’, ‘F’, ‘A’, ‘K’}, optional
The elements of a are read using this index order. ‘C’ means to index the elements in C-like order, with the last axis index changing fastest, b... | numpy.reference.generated.numpy.ma.ravel |
numpy.ma.reshape ma.reshape(a, new_shape, order='C')[source]
Returns an array containing the same data with a new shape. Refer to MaskedArray.reshape for full documentation. See also MaskedArray.reshape
equivalent function | numpy.reference.generated.numpy.ma.reshape |
numpy.ma.resize ma.resize(x, new_shape)[source]
Return a new masked array with the specified size and shape. This is the masked equivalent of the numpy.resize function. The new array is filled with repeated copies of x (in the order that the data are stored in memory). If x is masked, the new array will be masked, ... | numpy.reference.generated.numpy.ma.resize |
numpy.ma.round ma.round(a, decimals=0, out=None)[source]
Return a copy of a, rounded to ‘decimals’ places. When ‘decimals’ is negative, it specifies the number of positions to the left of the decimal point. The real and imaginary parts of complex numbers are rounded separately. Nothing is done if the array is not o... | numpy.reference.generated.numpy.ma.round |
numpy.ma.row_stack ma.row_stack(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_seq object>
Stack arrays in sequence vertically (row wise). This is equivalent to concatenation along the first axis after 1-D arrays of shape (N,) have been reshaped to (1,N). Rebuilds arrays divided by vsplit. This function makes ... | numpy.reference.generated.numpy.ma.row_stack |
numpy.ma.set_fill_value ma.set_fill_value(a, fill_value)[source]
Set the filling value of a, if a is a masked array. This function changes the fill value of the masked array a in place. If a is not a masked array, the function returns silently, without doing anything. Parameters
aarray_like
Input array.
fil... | numpy.reference.generated.numpy.ma.set_fill_value |
numpy.ma.shape ma.shape(obj)[source]
Return the shape of an array. Parameters
aarray_like
Input array. Returns
shapetuple of ints
The elements of the shape tuple give the lengths of the corresponding array dimensions. See also len
ndarray.shape
Equivalent array method. Examples >>> np.shape(... | numpy.reference.generated.numpy.ma.shape |
numpy.ma.size ma.size(obj, axis=None)[source]
Return the number of elements along a given axis. Parameters
aarray_like
Input data.
axisint, optional
Axis along which the elements are counted. By default, give the total number of elements. Returns
element_countint
Number of elements along the speci... | numpy.reference.generated.numpy.ma.size |
numpy.ma.soften_mask ma.soften_mask(self) = <numpy.ma.core._frommethod object>
Force the mask to soft. Whether the mask of a masked array is hard or soft is determined by its hardmask property. soften_mask sets hardmask to False. See also ma.MaskedArray.hardmask | numpy.reference.generated.numpy.ma.soften_mask |
numpy.ma.sort ma.sort(a, axis=- 1, kind=None, order=None, endwith=True, fill_value=None)[source]
Return a sorted copy of the masked array. Equivalent to creating a copy of the array and applying the MaskedArray sort() method. Refer to MaskedArray.sort for the full documentation See also MaskedArray.sort
equivale... | numpy.reference.generated.numpy.ma.sort |
numpy.ma.squeeze ma.squeeze(*args, **kwargs) = <numpy.ma.core._convert2ma object>
Remove axes of length one from a. Parameters
aarray_like
Input data.
axisNone or int or tuple of ints, optional
New in version 1.7.0. Selects a subset of the entries of length one in the shape. If an axis is selected with ... | numpy.reference.generated.numpy.ma.squeeze |
numpy.ma.stack ma.stack(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_seq object>
Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimensi... | numpy.reference.generated.numpy.ma.stack |
numpy.ma.std ma.std(self, axis=None, dtype=None, out=None, ddof=0, keepdims=<no value>) = <numpy.ma.core._frommethod object>
Returns the standard deviation of the array elements along given axis. Masked entries are ignored. Refer to numpy.std for full documentation. See also numpy.ndarray.std
corresponding funct... | numpy.reference.generated.numpy.ma.std |
numpy.ma.sum ma.sum(self, axis=None, dtype=None, out=None, keepdims=<no value>) = <numpy.ma.core._frommethod object>
Return the sum of the array elements over the given axis. Masked elements are set to 0 internally. Refer to numpy.sum for full documentation. See also numpy.ndarray.sum
corresponding function for ... | numpy.reference.generated.numpy.ma.sum |
numpy.ma.swapaxes ma.swapaxes(self, *args, **params) a.swapaxes(axis1, axis2) = <numpy.ma.core._frommethod object>
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.reference.generated.numpy.ma.swapaxes |
numpy.ma.trace ma.trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None) a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None) = <numpy.ma.core._frommethod object>
Return the sum along diagonals of the array. Refer to numpy.trace for full documentation. See also numpy.trace
equivalent function | numpy.reference.generated.numpy.ma.trace |
numpy.ma.transpose ma.transpose(a, axes=None)[source]
Permute the dimensions of an array. This function is exactly equivalent to numpy.transpose. See also numpy.transpose
Equivalent function in top-level NumPy module. Examples >>> import numpy.ma as ma
>>> x = ma.arange(4).reshape((2,2))
>>> x[1, 1] = ma.mask... | numpy.reference.generated.numpy.ma.transpose |
numpy.ma.vander ma.vander(x, n=None)[source]
Generate a Vandermonde matrix. The columns of the output matrix are powers of the input vector. The order of the powers is determined by the increasing boolean argument. Specifically, when increasing is False, the i-th output column is the input vector raised element-wis... | numpy.reference.generated.numpy.ma.vander |
numpy.ma.var ma.var(self, axis=None, dtype=None, out=None, ddof=0, keepdims=<no value>) = <numpy.ma.core._frommethod object>
Compute the variance along the specified axis. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by defau... | numpy.reference.generated.numpy.ma.var |
numpy.ma.vstack ma.vstack(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_seq object>
Stack arrays in sequence vertically (row wise). This is equivalent to concatenation along the first axis after 1-D arrays of shape (N,) have been reshaped to (1,N). Rebuilds arrays divided by vsplit. This function makes most s... | numpy.reference.generated.numpy.ma.vstack |
numpy.ma.where ma.where(condition, x=<no value>, y=<no value>)[source]
Return a masked array with elements from x or y, depending on condition. Note When only condition is provided, this function is identical to nonzero. The rest of this documentation covers only the case where all three arguments are provided. ... | numpy.reference.generated.numpy.ma.where |
numpy.ma.zeros ma.zeros(shape, dtype=float, order='C', *, like=None) = <numpy.ma.core._convert2ma object>
Return a new array of given shape and type, filled with zeros. Parameters
shapeint or tuple of ints
Shape of the new array, e.g., (2, 3) or 2.
dtypedata-type, optional
The desired data-type for the ar... | numpy.reference.generated.numpy.ma.zeros |
numpy.ma.zeros_like ma.zeros_like(*args, **kwargs) = <numpy.ma.core._convert2ma object>
Return an array of zeros with the same shape and type as a given array. Parameters
aarray_like
The shape and data-type of a define these same attributes of the returned array.
dtypedata-type, optional
Overrides the dat... | numpy.reference.generated.numpy.ma.zeros_like |
make_config_py(name='__config__')[source]
Generate package __config__.py file containing system_info information used during building the package. This file is installed to the package installation directory. | numpy.reference.distutils#numpy.distutils.misc_util.Configuration.make_config_py |
make_svn_version_py(delete=True)[source]
Appends a data function to the data_files list that will generate __svn_version__.py file to the current package directory. Generate package __svn_version__.py file from SVN revision number, it will be removed after python exits but will be available when sdist, etc commands a... | numpy.reference.distutils#numpy.distutils.misc_util.Configuration.make_svn_version_py |
Constants of the numpy.ma module In addition to the MaskedArray class, the numpy.ma 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 ... | numpy.reference.maskedarray.baseclass#numpy.ma.MaskedArray.baseclass |
Constants of the numpy.ma module In addition to the MaskedArray class, the numpy.ma 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 ... | numpy.reference.maskedarray.baseclass#numpy.ma.MaskedArray.fill_value |
Constants of the numpy.ma module In addition to the MaskedArray class, the numpy.ma 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 ... | numpy.reference.maskedarray.baseclass#numpy.ma.MaskedArray.hardmask |
Constants of the numpy.ma module In addition to the MaskedArray class, the numpy.ma 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 ... | numpy.reference.maskedarray.baseclass#numpy.ma.MaskedArray.mask |
Constants of the numpy.ma module In addition to the MaskedArray class, the numpy.ma 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 ... | numpy.reference.maskedarray.baseclass#numpy.ma.MaskedArray.recordmask |
Constants of the numpy.ma module In addition to the MaskedArray class, the numpy.ma 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 ... | numpy.reference.maskedarray.baseclass#numpy.ma.MaskedArray.sharedmask |
numpy.matlib.empty matlib.empty(shape, dtype=None, order='C')[source]
Return a new matrix of given shape and type, without initializing entries. Parameters
shapeint or tuple of int
Shape of the empty matrix.
dtypedata-type, optional
Desired output data-type.
order{‘C’, ‘F’}, optional
Whether to store ... | numpy.reference.generated.numpy.matlib.empty |
numpy.matlib.eye matlib.eye(n, M=None, k=0, dtype=<class 'float'>, order='C')[source]
Return a matrix with ones on the diagonal and zeros elsewhere. Parameters
nint
Number of rows in the output.
Mint, optional
Number of columns in the output, defaults to n.
kint, optional
Index of the diagonal: 0 refe... | numpy.reference.generated.numpy.matlib.eye |
numpy.matlib.identity matlib.identity(n, dtype=None)[source]
Returns the square identity matrix of given size. Parameters
nint
Size of the returned identity matrix.
dtypedata-type, optional
Data-type of the output. Defaults to float. Returns
outmatrix
n x n matrix with its main diagonal set to one... | numpy.reference.generated.numpy.matlib.identity |
numpy.matlib.ones matlib.ones(shape, dtype=None, order='C')[source]
Matrix of ones. Return a matrix of given shape and type, filled with ones. Parameters
shape{sequence of ints, int}
Shape of the matrix
dtypedata-type, optional
The desired data-type for the matrix, default is np.float64.
order{‘C’, ‘F’}... | numpy.reference.generated.numpy.matlib.ones |
numpy.matlib.rand matlib.rand(*args)[source]
Return a matrix of random values with given shape. Create a matrix of the given shape and propagate it with random samples from a uniform distribution over [0, 1). Parameters
*argsArguments
Shape of the output. If given as N integers, each integer specifies the siz... | numpy.reference.generated.numpy.matlib.rand |
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 univariate “normal” (Gaussian) distribution of mean 0 and variance 1. Parameters
*argsArguments
Shape of the output. If giv... | numpy.reference.generated.numpy.matlib.randn |
numpy.matlib.repmat matlib.repmat(a, m, n)[source]
Repeat a 0-D to 2-D array or matrix MxN times. Parameters
aarray_like
The array or matrix to be repeated.
m, nint
The number of times a is repeated along the first and second axes. Returns
outndarray
The result of repeating a. Examples >>> imp... | numpy.reference.generated.numpy.matlib.repmat |
numpy.matlib.zeros matlib.zeros(shape, dtype=None, order='C')[source]
Return a matrix of given shape and type, filled with zeros. Parameters
shapeint or sequence of ints
Shape of the matrix
dtypedata-type, optional
The desired data-type for the matrix, default is float.
order{‘C’, ‘F’}, optional
Wheth... | numpy.reference.generated.numpy.matlib.zeros |
numpy.matrix.all method matrix.all(axis=None, out=None)[source]
Test whether all matrix elements along a given axis evaluate to True. Parameters
See `numpy.all` for complete descriptions
See also numpy.all
Notes This is the same as ndarray.all, but it returns a matrix object. Examples >>> x = np.matrix(np... | numpy.reference.generated.numpy.matrix.all |
numpy.matrix.any method matrix.any(axis=None, out=None)[source]
Test whether any array element along a given axis evaluates to True. Refer to numpy.any for full documentation. Parameters
axisint, optional
Axis along which logical OR is performed
outndarray, optional
Output to existing array instead of cre... | numpy.reference.generated.numpy.matrix.any |
numpy.matrix.argmax method matrix.argmax(axis=None, out=None)[source]
Indexes of the maximum values along an axis. Return the indexes of the first occurrences of the maximum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters
See `numpy.argmax` for complete descrip... | numpy.reference.generated.numpy.matrix.argmax |
numpy.matrix.argmin method matrix.argmin(axis=None, out=None)[source]
Indexes of the minimum values along an axis. Return the indexes of the first occurrences of the minimum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters
See `numpy.argmin` for complete descrip... | numpy.reference.generated.numpy.matrix.argmin |
numpy.matrix.argpartition method matrix.argpartition(kth, axis=- 1, kind='introselect', order=None)
Returns the indices that would partition this array. Refer to numpy.argpartition for full documentation. New in version 1.8.0. See also numpy.argpartition
equivalent function | numpy.reference.generated.numpy.matrix.argpartition |
numpy.matrix.argsort method matrix.argsort(axis=- 1, kind=None, order=None)
Returns the indices that would sort this array. Refer to numpy.argsort for full documentation. See also numpy.argsort
equivalent function | numpy.reference.generated.numpy.matrix.argsort |
numpy.matrix.astype method matrix.astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
Copy of the array, cast to a specified type. Parameters
dtypestr or dtype
Typecode or data-type to which the array is cast.
order{‘C’, ‘F’, ‘A’, ‘K’}, optional
Controls the memory layout order of the result... | numpy.reference.generated.numpy.matrix.astype |
numpy.matrix.base attribute matrix.base
Base object if memory is from some other object. Examples The base of an array that owns its memory is None: >>> x = np.array([1,2,3,4])
>>> x.base is None
True
Slicing creates a view, whose memory is shared with x: >>> y = x[2:]
>>> y.base is x
True | numpy.reference.generated.numpy.matrix.base |
numpy.matrix.byteswap 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 swapped. The real and imaginary parts of a complex number are sw... | numpy.reference.generated.numpy.matrix.byteswap |
numpy.matrix.choose method matrix.choose(choices, out=None, mode='raise')
Use an index array to construct a new array from a set of choices. Refer to numpy.choose for full documentation. See also numpy.choose
equivalent function | numpy.reference.generated.numpy.matrix.choose |
numpy.matrix.clip method matrix.clip(min=None, max=None, out=None, **kwargs)
Return an array whose values are limited to [min, max]. One of max or min must be given. Refer to numpy.clip for full documentation. See also numpy.clip
equivalent function | numpy.reference.generated.numpy.matrix.clip |
numpy.matrix.compress method matrix.compress(condition, axis=None, out=None)
Return selected slices of this array along given axis. Refer to numpy.compress for full documentation. See also numpy.compress
equivalent function | numpy.reference.generated.numpy.matrix.compress |
numpy.matrix.conj method matrix.conj()
Complex-conjugate all elements. Refer to numpy.conjugate for full documentation. See also numpy.conjugate
equivalent function | numpy.reference.generated.numpy.matrix.conj |
numpy.matrix.conjugate method matrix.conjugate()
Return the complex conjugate, element-wise. Refer to numpy.conjugate for full documentation. See also numpy.conjugate
equivalent function | numpy.reference.generated.numpy.matrix.conjugate |
numpy.matrix.copy method matrix.copy(order='C')
Return a copy of the array. Parameters
order{‘C’, ‘F’, ‘A’, ‘K’}, optional
Controls the memory layout of the copy. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ means match the layout of a as closely as possib... | numpy.reference.generated.numpy.matrix.copy |
numpy.matrix.ctypes attribute matrix.ctypes
An object to simplify the interaction of the array with the ctypes module. This attribute creates an object that makes it easier to use arrays when calling shared libraries with the ctypes module. The returned object has, among others, data, shape, and strides attributes ... | numpy.reference.generated.numpy.matrix.ctypes |
numpy.matrix.cumprod method matrix.cumprod(axis=None, dtype=None, out=None)
Return the cumulative product of the elements along the given axis. Refer to numpy.cumprod for full documentation. See also numpy.cumprod
equivalent function | numpy.reference.generated.numpy.matrix.cumprod |
numpy.matrix.cumsum method matrix.cumsum(axis=None, dtype=None, out=None)
Return the cumulative sum of the elements along the given axis. Refer to numpy.cumsum for full documentation. See also numpy.cumsum
equivalent function | numpy.reference.generated.numpy.matrix.cumsum |
numpy.matrix.data attribute matrix.data
Python buffer object pointing to the start of the array’s data. | numpy.reference.generated.numpy.matrix.data |
numpy.matrix.diagonal method matrix.diagonal(offset=0, axis1=0, axis2=1)
Return specified diagonals. In NumPy 1.9 the returned array is a read-only view instead of a copy as in previous NumPy versions. In a future version the read-only restriction will be removed. Refer to numpy.diagonal for full documentation. Se... | numpy.reference.generated.numpy.matrix.diagonal |
numpy.matrix.dump method matrix.dump(file)
Dump a pickle of the array to the specified file. The array can be read back with pickle.load or numpy.load. Parameters
filestr or Path
A string naming the dump file. Changed in version 1.17.0: pathlib.Path objects are now accepted. | numpy.reference.generated.numpy.matrix.dump |
numpy.matrix.dumps method matrix.dumps()
Returns the pickle of the array as a string. pickle.loads will convert the string back to an array. Parameters
None | numpy.reference.generated.numpy.matrix.dumps |
numpy.matrix.fill method matrix.fill(value)
Fill the array with a scalar value. Parameters
valuescalar
All elements of a will be assigned this value. Examples >>> a = np.array([1, 2])
>>> a.fill(0)
>>> a
array([0, 0])
>>> a = np.empty(2)
>>> a.fill(1)
>>> a
array([1., 1.]) | numpy.reference.generated.numpy.matrix.fill |
numpy.matrix.flags attribute matrix.flags
Information about the memory layout of the array. Notes The flags object can be accessed dictionary-like (as in a.flags['WRITEABLE']), or by using lowercased attribute names (as in a.flags.writeable). Short flag names are only supported in dictionary access. Only the WRITEB... | numpy.reference.generated.numpy.matrix.flags |
numpy.matrix.flat attribute matrix.flat
A 1-D iterator over the array. This is a numpy.flatiter instance, which acts similarly to, but is not a subclass of, Python’s built-in iterator object. See also flatten
Return a copy of the array collapsed into one dimension. flatiter
Examples >>> x = np.arange(1, 7).re... | numpy.reference.generated.numpy.matrix.flat |
numpy.matrix.flatten method matrix.flatten(order='C')[source]
Return a flattened copy of the matrix. All N elements of the matrix are placed into a single row. Parameters
order{‘C’, ‘F’, ‘A’, ‘K’}, optional
‘C’ means to flatten in row-major (C-style) order. ‘F’ means to flatten in column-major (Fortran-style)... | numpy.reference.generated.numpy.matrix.flatten |
numpy.matrix.getA method matrix.getA()[source]
Return self as an ndarray object. Equivalent to np.asarray(self). Parameters
None
Returns
retndarray
self as an ndarray Examples >>> x = np.matrix(np.arange(12).reshape((3,4))); x
matrix([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11... | numpy.reference.generated.numpy.matrix.geta |
numpy.matrix.getA1 method matrix.getA1()[source]
Return self as a flattened ndarray. Equivalent to np.asarray(x).ravel() Parameters
None
Returns
retndarray
self, 1-D, as an ndarray Examples >>> x = np.matrix(np.arange(12).reshape((3,4))); x
matrix([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[... | numpy.reference.generated.numpy.matrix.geta1 |
numpy.matrix.getfield method 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 array in bytes. The offset needs to be such that the... | numpy.reference.generated.numpy.matrix.getfield |
numpy.matrix.getH method matrix.getH()[source]
Returns the (complex) conjugate transpose of self. Equivalent to np.transpose(self) if self is real-valued. Parameters
None
Returns
retmatrix object
complex conjugate transpose of self Examples >>> x = np.matrix(np.arange(12).reshape((3,4)))
>>> z = x - 1... | numpy.reference.generated.numpy.matrix.geth |
numpy.matrix.getI method matrix.getI()[source]
Returns the (multiplicative) inverse of invertible self. Parameters
None
Returns
retmatrix object
If self is non-singular, ret is such that ret * self == self * ret == np.matrix(np.eye(self[0,:].size)) all return True. Raises
numpy.linalg.LinAlgError: Si... | numpy.reference.generated.numpy.matrix.geti |
numpy.matrix.getT method matrix.getT()[source]
Returns the transpose of the matrix. Does not conjugate! For the complex conjugate transpose, use .H. Parameters
None
Returns
retmatrix object
The (non-conjugated) transpose of the matrix. See also
transpose, getH
Examples >>> m = np.matrix('[1, 2; ... | numpy.reference.generated.numpy.matrix.gett |
numpy.matrix.item method matrix.item(*args)
Copy an element of an array to a standard Python scalar and return it. Parameters
*argsArguments (variable number and type)
none: in this case, the method only works for arrays with one element (a.size == 1), which element is copied into a standard Python scalar ob... | numpy.reference.generated.numpy.matrix.item |
numpy.matrix.itemset method matrix.itemset(*args)
Insert scalar into an array (scalar is cast to array’s dtype, if possible) There must be at least 1 argument, and define the last argument as item. Then, a.itemset(*args) is equivalent to but faster than a[args] = item. The item should be a scalar value and args mus... | numpy.reference.generated.numpy.matrix.itemset |
numpy.matrix.itemsize attribute matrix.itemsize
Length of one array element in bytes. Examples >>> x = np.array([1,2,3], dtype=np.float64)
>>> x.itemsize
8
>>> x = np.array([1,2,3], dtype=np.complex128)
>>> x.itemsize
16 | numpy.reference.generated.numpy.matrix.itemsize |
numpy.matrix.max method matrix.max(axis=None, out=None)[source]
Return the maximum value along an axis. Parameters
See `amax` for complete descriptions
See also
amax, ndarray.max
Notes This is the same as ndarray.max, but returns a matrix object where ndarray.max would return an ndarray. Examples >>> x ... | numpy.reference.generated.numpy.matrix.max |
numpy.matrix.mean method matrix.mean(axis=None, dtype=None, out=None)[source]
Returns the average of the matrix elements along the given axis. Refer to numpy.mean for full documentation. See also numpy.mean
Notes Same as ndarray.mean except that, where that returns an ndarray, this returns a matrix object. Exam... | numpy.reference.generated.numpy.matrix.mean |
numpy.matrix.min method matrix.min(axis=None, out=None)[source]
Return the minimum value along an axis. Parameters
See `amin` for complete descriptions.
See also
amin, ndarray.min
Notes This is the same as ndarray.min, but returns a matrix object where ndarray.min would return an ndarray. Examples >>> x... | numpy.reference.generated.numpy.matrix.min |
numpy.matrix.nbytes attribute matrix.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.reference.generated.numpy.matrix.nbytes |
numpy.matrix.ndim attribute matrix.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.reference.generated.numpy.matrix.ndim |
numpy.matrix.newbyteorder method matrix.newbyteorder(new_order='S', /)
Return the array with the same data viewed with a different byte order. Equivalent to: arr.view(arr.dtype.newbytorder(new_order))
Changes are also made in all fields and sub-arrays of the array data type. Parameters
new_orderstring, optiona... | numpy.reference.generated.numpy.matrix.newbyteorder |
numpy.matrix.nonzero method matrix.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.reference.generated.numpy.matrix.nonzero |
numpy.matrix.partition method matrix.partition(kth, axis=- 1, kind='introselect', order=None)
Rearranges the elements in the array in such a way that the value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved before this element and... | numpy.reference.generated.numpy.matrix.partition |
numpy.matrix.prod method matrix.prod(axis=None, dtype=None, out=None)[source]
Return the product of the array elements over the given axis. Refer to prod for full documentation. See also
prod, ndarray.prod
Notes Same as ndarray.prod, except, where that returns an ndarray, this returns a matrix object instead.... | numpy.reference.generated.numpy.matrix.prod |
numpy.matrix.ptp method matrix.ptp(axis=None, out=None)[source]
Peak-to-peak (maximum - minimum) value along the given axis. Refer to numpy.ptp for full documentation. See also numpy.ptp
Notes Same as ndarray.ptp, except, where that would return an ndarray object, this returns a matrix object. Examples >>> x = ... | numpy.reference.generated.numpy.matrix.ptp |
numpy.matrix.put method matrix.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.reference.generated.numpy.matrix.put |
numpy.matrix.ravel method matrix.ravel(order='C')[source]
Return a flattened matrix. Refer to numpy.ravel for more documentation. Parameters
order{‘C’, ‘F’, ‘A’, ‘K’}, optional
The elements of m are read using this index order. ‘C’ means to index the elements in C-like order, with the last axis index changing... | numpy.reference.generated.numpy.matrix.ravel |
numpy.matrix.repeat method matrix.repeat(repeats, axis=None)
Repeat elements of an array. Refer to numpy.repeat for full documentation. See also numpy.repeat
equivalent function | numpy.reference.generated.numpy.matrix.repeat |
numpy.matrix.reshape method matrix.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 sha... | numpy.reference.generated.numpy.matrix.reshape |
numpy.matrix.resize method matrix.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
I... | numpy.reference.generated.numpy.matrix.resize |
numpy.matrix.round method matrix.round(decimals=0, out=None)
Return a with each element rounded to the given number of decimals. Refer to numpy.around for full documentation. See also numpy.around
equivalent function | numpy.reference.generated.numpy.matrix.round |
numpy.matrix.searchsorted method matrix.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.reference.generated.numpy.matrix.searchsorted |
numpy.matrix.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
valobject
Value to be placed in field.
dtypedtype object
Data-type of the... | numpy.reference.generated.numpy.matrix.setfield |
numpy.matrix.setflags method matrix.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 dat... | numpy.reference.generated.numpy.matrix.setflags |
numpy.matrix.size attribute matrix.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.s... | numpy.reference.generated.numpy.matrix.size |
numpy.matrix.sort method matrix.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... | numpy.reference.generated.numpy.matrix.sort |
numpy.matrix.squeeze method matrix.squeeze(axis=None)[source]
Return a possibly reshaped matrix. Refer to numpy.squeeze for more documentation. Parameters
axisNone or int or tuple of ints, optional
Selects a subset of the axes of length one in the shape. If an axis is selected with shape entry greater than on... | numpy.reference.generated.numpy.matrix.squeeze |
numpy.matrix.std method matrix.std(axis=None, dtype=None, out=None, ddof=0)[source]
Return the standard deviation of the array elements along the given axis. Refer to numpy.std for full documentation. See also numpy.std
Notes This is the same as ndarray.std, except that where an ndarray would be returned, a mat... | numpy.reference.generated.numpy.matrix.std |
numpy.matrix.strides attribute matrix.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 refe... | numpy.reference.generated.numpy.matrix.strides |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.