human
How to find all elements in a numpy 2-dimensional array that match a certain list?
assistant
Here is some code to replace all elements in array `A` that are not present in array `[1, 3, 4]` with zeros

np.where(np.in1d(A, [1, 3, 4]).reshape(A.shape), A, 0)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.