[PYTHON] numpy's matrix and mat are different

I was addicted to using numpy the other day, but it seems that numpy's matrix and mat are different. Looking at the Original Document, mat ismatrix (data, copy = False) It is written as equivalent, and it seems that it is not copied. What does this mean?

>>> import numpy as np
>>> m = np.matrix([[1.0, 2.0],[3.0, 4.0]])
>>> m
matrix([[ 1.,  2.],
        [ 3.,  4.]])
>>> a = np.matrix(m)
>>> a[0, 0] = 5.0
>>> a
matrix([[ 5.,  2.],
        [ 3.,  4.]])
>>> m
matrix([[ 1.,  2.],
        [ 3.,  4.]])
>>> #Even if a is changed, m does not change
>>> 
>>> b = np.mat(m)
>>> b[0, 0] = 6.0
>>> b
matrix([[ 6.,  2.],
        [ 3.,  4.]])
>>> m
matrix([[ 6.,  2.],
        [ 3.,  4.]])
>>> #Changing b changes m

I was a little addicted to it, so I wrote it.

Recommended Posts

numpy's matrix and mat are different
Are macOS and Linux completely different?
yum and apt update / upgrade are different
The VIF calculated by Python and the VIF calculated by Excel are different .. ??
Where are matrix products and inner products used in deep learning?