doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
numpy.matrix.sum method matrix.sum(axis=None, dtype=None, out=None)[source] Returns the sum of the matrix elements, along the given axis. Refer to numpy.sum for full documentation. See also numpy.sum Notes This is the same as ndarray.sum, except that where an ndarray would be returned, a matrix object is return...
numpy.reference.generated.numpy.matrix.sum
numpy.matrix.swapaxes method matrix.swapaxes(axis1, axis2) Return a view of the array with axis1 and axis2 interchanged. Refer to numpy.swapaxes for full documentation. See also numpy.swapaxes equivalent function
numpy.reference.generated.numpy.matrix.swapaxes
numpy.matrix.take method matrix.take(indices, axis=None, out=None, mode='raise') Return an array formed from the elements of a at the given indices. Refer to numpy.take for full documentation. See also numpy.take equivalent function
numpy.reference.generated.numpy.matrix.take
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 produced in C-order by default. This behavior is controlled by the order parameter. New in version ...
numpy.reference.generated.numpy.matrix.tobytes
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 using the function fromfile(). Parameters fidfile or str or Path An open f...
numpy.reference.generated.numpy.matrix.tofile
numpy.matrix.tolist method matrix.tolist()[source] Return the matrix as a (possibly nested) list. See ndarray.tolist for full documentation. See also ndarray.tolist Examples >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.to...
numpy.reference.generated.numpy.matrix.tolist
numpy.matrix.tostring method matrix.tostring(order='C') A compatibility alias for tobytes, with exactly the same behavior. Despite its name, it returns bytes not strs. Deprecated since version 1.19.0.
numpy.reference.generated.numpy.matrix.tostring
numpy.matrix.trace method matrix.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None) 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.matrix.trace
numpy.matrix.transpose method matrix.transpose(*axes) Returns a view of the array with axes transposed. For a 1-D array this has no effect, as a transposed vector is simply the same vector. To convert a 1-D array into a 2D column vector, an additional dimension must be added. np.atleast2d(a).T achieves this, as doe...
numpy.reference.generated.numpy.matrix.transpose
numpy.matrix.var method matrix.var(axis=None, dtype=None, out=None, ddof=0)[source] Returns the variance of the matrix elements, along the given axis. Refer to numpy.var for full documentation. See also numpy.var Notes This is the same as ndarray.var, except that where an ndarray would be returned, a matrix obj...
numpy.reference.generated.numpy.matrix.var
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 is an alias for dtype('float_'). Parameters dtypedata-type or ndarray sub-class, optional Data-type des...
numpy.reference.generated.numpy.matrix.view
numpy.memmap.flush method memmap.flush()[source] Write any changes in the array to the file on disk. For further information, see memmap. Parameters None See also memmap
numpy.reference.generated.numpy.memmap.flush
Miscellaneous IEEE 754 Floating Point Special Values Special values defined in numpy: nan, inf, NaNs can be used as a poor-man’s mask (if you don’t care what the original value was) Note: cannot use equality to test NaNs. E.g.: >>> myarr = np.array([1., 0., np.nan, 3.]) >>> np.nonzero(myarr == np.nan) (array([], dtype...
numpy.user.misc
numpy.ndarray.__abs__ method ndarray.__abs__(self)
numpy.reference.generated.numpy.ndarray.__abs__
numpy.ndarray.__add__ method ndarray.__add__(value, /) Return self+value.
numpy.reference.generated.numpy.ndarray.__add__
numpy.ndarray.__and__ method ndarray.__and__(value, /) Return self&value.
numpy.reference.generated.numpy.ndarray.__and__
numpy.ndarray.__array__ method ndarray.__array__([dtype, ]/) → reference if type unchanged, copy otherwise. Returns either a new reference to self if dtype is not given or a new array of provided data type if dtype is different from the current dtype of the array.
numpy.reference.generated.numpy.ndarray.__array__
numpy.ndarray.__array_wrap__ method ndarray.__array_wrap__(array, [context, ]/) Returns a view of array with the same type as self.
numpy.reference.generated.numpy.ndarray.__array_wrap__
numpy.ndarray.__bool__ method ndarray.__bool__(/) self != 0
numpy.reference.generated.numpy.ndarray.__bool__
numpy.ndarray.__class_getitem__ method ndarray.__class_getitem__(item, /) Return a parametrized wrapper around the ndarray type. New in version 1.22. Returns aliastypes.GenericAlias A parametrized ndarray type. See also PEP 585 Type hinting generics in standard collections. numpy.typing.NDArray An ...
numpy.reference.generated.numpy.ndarray.__class_getitem__
numpy.ndarray.__complex__ method ndarray.__complex__()
numpy.reference.generated.numpy.ndarray.__complex__
numpy.ndarray.__contains__ method ndarray.__contains__(key, /) Return key in self.
numpy.reference.generated.numpy.ndarray.__contains__
numpy.ndarray.__copy__ method ndarray.__copy__() Used if copy.copy is called on an array. Returns a copy of the array. Equivalent to a.copy(order='K').
numpy.reference.generated.numpy.ndarray.__copy__
numpy.ndarray.__deepcopy__ method ndarray.__deepcopy__(memo, /) → Deep copy of array. Used if copy.deepcopy is called on an array.
numpy.reference.generated.numpy.ndarray.__deepcopy__
numpy.ndarray.__divmod__ method ndarray.__divmod__(value, /) Return divmod(self, value).
numpy.reference.generated.numpy.ndarray.__divmod__
numpy.ndarray.__eq__ method ndarray.__eq__(value, /) Return self==value.
numpy.reference.generated.numpy.ndarray.__eq__
numpy.ndarray.__float__ method ndarray.__float__(self)
numpy.reference.generated.numpy.ndarray.__float__
numpy.ndarray.__floordiv__ method ndarray.__floordiv__(value, /) Return self//value.
numpy.reference.generated.numpy.ndarray.__floordiv__
numpy.ndarray.__ge__ method ndarray.__ge__(value, /) Return self>=value.
numpy.reference.generated.numpy.ndarray.__ge__
numpy.ndarray.__getitem__ method ndarray.__getitem__(key, /) Return self[key].
numpy.reference.generated.numpy.ndarray.__getitem__
numpy.ndarray.__gt__ method ndarray.__gt__(value, /) Return self>value.
numpy.reference.generated.numpy.ndarray.__gt__
numpy.ndarray.__iadd__ method ndarray.__iadd__(value, /) Return self+=value.
numpy.reference.generated.numpy.ndarray.__iadd__
numpy.ndarray.__iand__ method ndarray.__iand__(value, /) Return self&=value.
numpy.reference.generated.numpy.ndarray.__iand__
numpy.ndarray.__ifloordiv__ method ndarray.__ifloordiv__(value, /) Return self//=value.
numpy.reference.generated.numpy.ndarray.__ifloordiv__
numpy.ndarray.__ilshift__ method ndarray.__ilshift__(value, /) Return self<<=value.
numpy.reference.generated.numpy.ndarray.__ilshift__
numpy.ndarray.__imod__ method ndarray.__imod__(value, /) Return self%=value.
numpy.reference.generated.numpy.ndarray.__imod__
numpy.ndarray.__imul__ method ndarray.__imul__(value, /) Return self*=value.
numpy.reference.generated.numpy.ndarray.__imul__
numpy.ndarray.__int__ method ndarray.__int__(self)
numpy.reference.generated.numpy.ndarray.__int__
numpy.ndarray.__invert__ method ndarray.__invert__(/) ~self
numpy.reference.generated.numpy.ndarray.__invert__
numpy.ndarray.__ior__ method ndarray.__ior__(value, /) Return self|=value.
numpy.reference.generated.numpy.ndarray.__ior__
numpy.ndarray.__ipow__ method ndarray.__ipow__(value, /) Return self**=value.
numpy.reference.generated.numpy.ndarray.__ipow__
numpy.ndarray.__irshift__ method ndarray.__irshift__(value, /) Return self>>=value.
numpy.reference.generated.numpy.ndarray.__irshift__
numpy.ndarray.__isub__ method ndarray.__isub__(value, /) Return self-=value.
numpy.reference.generated.numpy.ndarray.__isub__
numpy.ndarray.__itruediv__ method ndarray.__itruediv__(value, /) Return self/=value.
numpy.reference.generated.numpy.ndarray.__itruediv__
numpy.ndarray.__ixor__ method ndarray.__ixor__(value, /) Return self^=value.
numpy.reference.generated.numpy.ndarray.__ixor__
numpy.ndarray.__le__ method ndarray.__le__(value, /) Return self<=value.
numpy.reference.generated.numpy.ndarray.__le__
numpy.ndarray.__len__ method ndarray.__len__(/) Return len(self).
numpy.reference.generated.numpy.ndarray.__len__
numpy.ndarray.__lshift__ method ndarray.__lshift__(value, /) Return self<<value.
numpy.reference.generated.numpy.ndarray.__lshift__
numpy.ndarray.__lt__ method ndarray.__lt__(value, /) Return self<value.
numpy.reference.generated.numpy.ndarray.__lt__
numpy.ndarray.__matmul__ method ndarray.__matmul__(value, /) Return self@value.
numpy.reference.generated.numpy.ndarray.__matmul__
numpy.ndarray.__mod__ method ndarray.__mod__(value, /) Return self%value.
numpy.reference.generated.numpy.ndarray.__mod__
numpy.ndarray.__mul__ method ndarray.__mul__(value, /) Return self*value.
numpy.reference.generated.numpy.ndarray.__mul__
numpy.ndarray.__ne__ method ndarray.__ne__(value, /) Return self!=value.
numpy.reference.generated.numpy.ndarray.__ne__
numpy.ndarray.__neg__ method ndarray.__neg__(/) -self
numpy.reference.generated.numpy.ndarray.__neg__
numpy.ndarray.__new__ method ndarray.__new__(*args, **kwargs)
numpy.reference.generated.numpy.ndarray.__new__
numpy.ndarray.__or__ method ndarray.__or__(value, /) Return self|value.
numpy.reference.generated.numpy.ndarray.__or__
numpy.ndarray.__pos__ method ndarray.__pos__(/) +self
numpy.reference.generated.numpy.ndarray.__pos__
numpy.ndarray.__pow__ method ndarray.__pow__(value, mod=None, /) Return pow(self, value, mod).
numpy.reference.generated.numpy.ndarray.__pow__
numpy.ndarray.__reduce__ method ndarray.__reduce__() For pickling.
numpy.reference.generated.numpy.ndarray.__reduce__
numpy.ndarray.__repr__ method ndarray.__repr__(/) Return repr(self).
numpy.reference.generated.numpy.ndarray.__repr__
numpy.ndarray.__rshift__ method ndarray.__rshift__(value, /) Return self>>value.
numpy.reference.generated.numpy.ndarray.__rshift__
numpy.ndarray.__setitem__ method ndarray.__setitem__(key, value, /) Set self[key] to value.
numpy.reference.generated.numpy.ndarray.__setitem__
numpy.ndarray.__setstate__ method ndarray.__setstate__(state, /) For unpickling. The state argument must be a sequence that contains the following elements: Parameters versionint optional pickle version. If omitted defaults to 0. shapetuple dtypedata-type isFortranbool rawdatastring or list a binary...
numpy.reference.generated.numpy.ndarray.__setstate__
numpy.ndarray.__str__ method ndarray.__str__(/) Return str(self).
numpy.reference.generated.numpy.ndarray.__str__
numpy.ndarray.__sub__ method ndarray.__sub__(value, /) Return self-value.
numpy.reference.generated.numpy.ndarray.__sub__
numpy.ndarray.__truediv__ method ndarray.__truediv__(value, /) Return self/value.
numpy.reference.generated.numpy.ndarray.__truediv__
numpy.ndarray.__xor__ method ndarray.__xor__(value, /) Return self^value.
numpy.reference.generated.numpy.ndarray.__xor__
numpy.ndarray.all method ndarray.all(axis=None, out=None, keepdims=False, *, where=True) Returns True if all elements evaluate to True. Refer to numpy.all for full documentation. See also numpy.all equivalent function
numpy.reference.generated.numpy.ndarray.all
numpy.ndarray.any method ndarray.any(axis=None, out=None, keepdims=False, *, where=True) Returns True if any of the elements of a evaluate to True. Refer to numpy.any for full documentation. See also numpy.any equivalent function
numpy.reference.generated.numpy.ndarray.any
numpy.ndarray.argmax method ndarray.argmax(axis=None, out=None) Return indices of the maximum values along the given axis. Refer to numpy.argmax for full documentation. See also numpy.argmax equivalent function
numpy.reference.generated.numpy.ndarray.argmax
numpy.ndarray.argmin method ndarray.argmin(axis=None, out=None) Return indices of the minimum values along the given axis. Refer to numpy.argmin for detailed documentation. See also numpy.argmin equivalent function
numpy.reference.generated.numpy.ndarray.argmin
numpy.ndarray.argpartition method ndarray.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.ndarray.argpartition
numpy.ndarray.argsort method ndarray.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.ndarray.argsort
numpy.ndarray.astype method ndarray.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 resu...
numpy.reference.generated.numpy.ndarray.astype
numpy.ndarray.base attribute ndarray.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.ndarray.base
numpy.ndarray.byteswap method ndarray.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 ...
numpy.reference.generated.numpy.ndarray.byteswap
numpy.ndarray.choose method ndarray.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.ndarray.choose
numpy.ndarray.clip method ndarray.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.ndarray.clip
numpy.ndarray.compress method ndarray.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.ndarray.compress
numpy.ndarray.conj method ndarray.conj() Complex-conjugate all elements. Refer to numpy.conjugate for full documentation. See also numpy.conjugate equivalent function
numpy.reference.generated.numpy.ndarray.conj
numpy.ndarray.conjugate method ndarray.conjugate() Return the complex conjugate, element-wise. Refer to numpy.conjugate for full documentation. See also numpy.conjugate equivalent function
numpy.reference.generated.numpy.ndarray.conjugate
numpy.ndarray.copy method ndarray.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 poss...
numpy.reference.generated.numpy.ndarray.copy
numpy.ndarray.ctypes attribute ndarray.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 attribute...
numpy.reference.generated.numpy.ndarray.ctypes
numpy.ndarray.cumprod method ndarray.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.ndarray.cumprod
numpy.ndarray.cumsum method ndarray.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.ndarray.cumsum
numpy.ndarray.data attribute ndarray.data Python buffer object pointing to the start of the array’s data.
numpy.reference.generated.numpy.ndarray.data
numpy.ndarray.diagonal method ndarray.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. ...
numpy.reference.generated.numpy.ndarray.diagonal
numpy.ndarray.dtype attribute ndarray.dtype Data-type of the array’s elements. Parameters None Returns dnumpy dtype object See also numpy.dtype Examples >>> x array([[0, 1], [2, 3]]) >>> x.dtype dtype('int32') >>> type(x.dtype) <type 'numpy.dtype'>
numpy.reference.generated.numpy.ndarray.dtype
numpy.ndarray.dump method ndarray.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.ndarray.dump
numpy.ndarray.dumps method ndarray.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.ndarray.dumps
numpy.ndarray.fill method ndarray.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.ndarray.fill
numpy.ndarray.flags attribute ndarray.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 WRIT...
numpy.reference.generated.numpy.ndarray.flags
numpy.ndarray.flat attribute ndarray.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)....
numpy.reference.generated.numpy.ndarray.flat
numpy.ndarray.flatten method ndarray.flatten(order='C') Return a copy of the array collapsed into one dimension. 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) order. ‘A’ means to flatten in column-major o...
numpy.reference.generated.numpy.ndarray.flatten
numpy.ndarray.getfield method ndarray.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 t...
numpy.reference.generated.numpy.ndarray.getfield
numpy.ndarray.imag attribute ndarray.imag The imaginary part of the array. Examples >>> x = np.sqrt([1+0j, 0+1j]) >>> x.imag array([ 0. , 0.70710678]) >>> x.imag.dtype dtype('float64')
numpy.reference.generated.numpy.ndarray.imag
numpy.ndarray.item method ndarray.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 ...
numpy.reference.generated.numpy.ndarray.item
numpy.ndarray.itemset method ndarray.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 m...
numpy.reference.generated.numpy.ndarray.itemset
numpy.ndarray.itemsize attribute ndarray.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.ndarray.itemsize
numpy.ndarray.max method ndarray.max(axis=None, out=None, keepdims=False, initial=<no value>, where=True) Return the maximum along a given axis. Refer to numpy.amax for full documentation. See also numpy.amax equivalent function
numpy.reference.generated.numpy.ndarray.max