I have an n * x numpy matrix, which could look like this:
a = np.array([[1, 0], [0, 1]])
and I have another n * n numpy matrix, which look like this:
b = np.array([[2, 2], [2, 2]])
I would like to replace zero elements of a with the corresponding element of b so I would get:
[[1, 2],
[2, 1]]
How can I do that?