matrix.newbyteorder()

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_order : string, optional Byte order to force; a value from the byte order specifications below. new_order codes can be any of: ?S? - swap dtype from current to opposite endian {?<?, ?L?} - little endian {?>?, ?B?} - big endian {?=

matrix.ndim

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

matrix.nbytes

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

matrix.min()

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 = -np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, -1, -2, -3], [ -4, -5, -6, -7], [ -8, -9, -10, -11]]) >>> x.min() -11 >>> x.min(0) matrix([[ -8, -9

matrix.mean()

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. 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.mean() 5.5 >>> x.mean(0)

matrix.max()

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 = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.max() 11 >>> x.max(0) matrix([[ 8, 9, 10, 11]]) >&

matrix.itemsize

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

matrix.itemset()

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 must select a single item in the array a. Parameters: *args : Arguments If one argument: a scalar, only used in case a is of size 1. If two arguments: the last argument is the value to be set and must be a sc

matrix.item()

matrix.item(*args) Copy an element of an array to a standard Python scalar and return it. Parameters: *args : Arguments (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 object and returned. int_type: this argument is interpreted as a flat index into the array, specifying which element to copy and return. tuple of int_types: functions as does a single int_type argument, exce

matrix.imag

matrix.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')