I have this piece of code:
import numpy as np
A=np.matrix('3 340 30; 5 2 23; 02 0 1')
(m,m)=A.shape;
P=np.eye(m);
a=np.copy(A)
print(A)
print(a)
print(P*a)
print(P*A)
When I print "A" and "a" they both show the same matrix on the screen. However, the result of the multiplication with matrix P are totally different.
print(P*A) shows [[ 3. 340. 30.]
[ 5. 2. 23.]
[ 2. 0. 1.]]
print(P*a) shows [[ 3. 0. 0.]
[ 0. 2. 0.]
[ 0. 0. 1.]]
Can someone explain what is going on?
Thanks.