Well, if we want to choose certain values to remain the same, and set others values to zero in a numpy array, we can
A = A == 1
if A has only 4 unique numbers 0,1,2,3.
However, if I want to select N different values, like
A = np.where(A==1 or A==2, A)
but this does not work, and the conditions are not neccessarily for 2 values only. How can i implement this idea?