matrix.nonzero()

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

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.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.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.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.I

matrix.I Returns the (multiplicative) inverse of invertible self. Parameters: None Returns: ret : matrix 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: Singular matrix If self is singular. See also linalg.inv Examples >>> m = np.matrix('[1, 2; 3, 4]'); m matrix([[1, 2], [3, 4]]) >>> m.getI() matrix([[-2. , 1. ], [ 1.5, -0.5]]) >&