I am trying to manipulate a copy of a matrix, as follows.
import numpy as np
A = np.matrix([[4, 1, -1, 1], [1, 4, -1, -1], [-1, -1, 5, 1], [1, -1, 1, 3]])
B = A
B[0, 0] = 0
This would change 00-entry of A to 0 as well, but I don't want this to happen. I tried it with np.array() as well, but the same thing happens again. I think this is because A and B are pointing to the same spot in the memory.
I'd appreciate it if anyone let's me know how to prevent A from changing, while B is changed.
B = Anever creates a copy in python no matter what objectsAandBrefer to