Solved by ptrblck in post #3 
              
              
                You could try to replace the sequential indexing with 
x[y.nonzero()[3]] = False

which should yield the desired result based on your example.