I have an array of size (1318, 1816), I would like to replace values other than that 23,43, and 64 to zero. I have tried np.where
, but returns an array full of zero. can anyone help me to correct the following code:
arr=np.array(img)
labels=[23,43,64]
arr_masked= np.where(arr!=labels,0,arr)