I was doing matrix exercises with numpy, but apparently it generated an error in the final answer:
As we can see the final result of Z*Z
is:
[[9,4,1],
[1,0,1],
[1,4,9],]
But after a suspicion I compared the results by hand with Mathcad and the result is:
[[10,4,-2],[4,4,4],[-2,4,10]]
the code to check it is:
from numpy import array
X=array([[-1,0,1],[-1,0,1],[-1,0,1]])
Y=array([[-2,-2,-2],[0,0,0],[2,2,2]])
Z=X+Y
Z=Z*Z
print(Z)
Numpy generated an error or to calculate the product of matrices is another command?