matrix.transpose()

matrix.transpose(*axes) Returns a view of the array with axes transposed. For a 1-D array, this has no effect. (To change between column and row vectors, first cast the 1-D array into a matrix object.) For a 2-D array, this is the usual matrix transpose. For an n-D array, if axes are given, their order indicates how the axes are permuted (see Examples). If axes are not provided and a.shape = (i[0], i[1], ... i[n-2], i[n-1]), then a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0]). Param

matrix.trace()

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

matrix.tostring()

matrix.tostring(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 can be produced in either ?C? or ?Fortran?, or ?Any? order (the default is ?C?-order). ?Any? order means C-order unless the F_CONTIGUOUS flag in the array is set, in which case it means ?Fortran? order. This function is a compatibility alias for tobytes. Despite its name it returns bytes not strings. Paramet

matrix.tolist()

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.tolist() [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]

matrix.tofile()

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: fid : file or str An open file object, or a string containing a filename. sep : str Separator between array items for text output. If ?? (empty), a binary file is written, equivalent to file.write(a.tobytes()). format : str Format string

matrix.tobytes()

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 can be produced in either ?C? or ?Fortran?, or ?Any? order (the default is ?C?-order). ?Any? order means C-order unless the F_CONTIGUOUS flag in the array is set, in which case it means ?Fortran? order. New in version 1.9.0. Parameters: order : {?C?, ?F?, None}, optional Order of the data for multidimensi

matrix.take()

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

matrix.T

matrix.T Returns the transpose of the matrix. Does not conjugate! For the complex conjugate transpose, use .H. Parameters: None Returns: ret : matrix object The (non-conjugated) transpose of the matrix. See also transpose, getH Examples >>> m = np.matrix('[1, 2; 3, 4]') >>> m matrix([[1, 2], [3, 4]]) >>> m.getT() matrix([[1, 3], [2, 4]])

matrix.swapaxes()

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

matrix.sum()

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 returned instead. Examples >>> x = np.matrix([[1, 2], [4, 3]]) >>> x.sum() 10 >>> x.sum(axis=1) matrix([[3], [7]]) >>> x.sum(axis=1, dtype='float') matrix([[ 3.],