Returns a matrix from an array-like object, or from a string of data. A matrix is a specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as * (matrix multiplication) and ** (matrix power).
| Parameters : | data : array_like or string
dtype : data-type
copy : bool
|
|---|
See also
Examples
>>> a = np.matrix('1 2; 3 4')
>>> print a
[[1 2]
[3 4]]
>>> np.matrix([[1, 2], [3, 4]])
matrix([[1, 2],
[3, 4]])
Methods
| all | |
| any | |
| argmax | |
| argmin | |
| argsort | |
| astype | |
| byteswap | |
| choose | |
| clip | |
| compress | |
| conj() | Return the complex conjugate, element-wise. |
| conjugate() | Return the complex conjugate, element-wise. |
| copy | |
| cumprod | |
| cumsum | |
| diagonal | |
| dot | |
| dump | |
| dumps | |
| fill | |
| flatten | |
| getA | |
| getA1 | |
| getH | |
| getI | |
| getT | |
| getfield | |
| item | |
| itemset | |
| max | |
| mean | |
| min | |
| newbyteorder | |
| nonzero | |
| prod | |
| ptp | |
| put | |
| ravel | |
| repeat | |
| reshape | |
| resize | |
| round | |
| searchsorted | |
| setasflat | |
| setfield | |
| setflags | |
| sort | |
| squeeze | |
| std | |
| sum | |
| swapaxes | |
| take | |
| tofile | |
| tolist | |
| tostring | |
| trace | |
| transpose | |
| var | |
| view |