On this page
numpy.mat
numpy.mat(data, dtype=None)[source]-
Interpret the input as a matrix.
Unlike
matrix,asmatrixdoes not make a copy if the input is already a matrix or an ndarray. Equivalent tomatrix(data, copy=False).Parameters: -
data : array_like -
Input data.
-
dtype : data-type -
Data-type of the output matrix.
Returns: -
mat : matrix -
datainterpreted as a matrix.
Examples
>>> x = np.array([[1, 2], [3, 4]])>>> m = np.asmatrix(x)>>> x[0,0] = 5>>> m matrix([[5, 2], [3, 4]]) -
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.mat.html