I have a matrix as below:
array([[1, 0, 1, 1, 0],
[1, 0, 0, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
[1, 0, 0, 0, 0]])
I want to choose randomly 3 position in this matrix, and change labels in those position and the position next to it. The result should be like this:
array([[1, 0, 1, 1, 0],
[1, 12, 12, 0, 0],
[0, 0, 0, 1, 0],
[0, 13, 13, 14, 14],
[1, 0, 0, 0, 0]])
The labels is choose randomly from list[10, 11, 12, 13, 14, 15]. How can I do this in python? Actually, I tried some methods but it doesn't work properly.