I am changing 0 to 2 in both examples.
>>> import numpy as np
>>> a=np.array([1,0,0,1,1,0])
>>> a[np.where(a==0)]=2
>>> a
array([1, 2, 2, 1, 1, 2])
>>> a=np.array([[1,0,0,1],[0,0,0,1],[0,1,0,1],[0,0,1,1]])
>>> a
array([[1, 0, 0, 1],
[0, 0, 0, 1],
[0, 1, 0, 1],
[0, 0, 1, 1]])
>>> a[np.where(a==0)]=2
>>> a
array([[1, 2, 2, 1],
[2, 2, 2, 1],
[2, 1, 2, 1],
[2, 2, 1, 1]])