I have numpy array like:
x = np.array([
...
[[0, 0, 0, 0],
[0, 1, 1, 0],
[0, 1, 1, 0],
[0, 0, 0, 0]]
...
])
with shape (4800, 4, 4).
So i need to replace every 0 with [1, 1, 2] and every 1 with [5, 5, 9]
Result should be like this:
[[[1, 1, 2], [1, 1, 2], [1, 1, 2], [1, 1, 2]],
[[1, 1, 2], [5, 5, 9], [5, 5, 9], [1, 1, 2]],
[[1, 1, 2], [5, 5, 9], [5, 5, 9], [1, 1, 2]],
[[1, 1, 2], [1, 1, 2], [1, 1, 2], [1, 1, 2]]]
How do I do this?