here is my problem: I would like to create a boolean matrix B that contains True everywhere that matrix A has a value contained in vector v. One inconvenient so
I think the closest you'll get is numpy.ismember1d, but it won't work well with your example. I think your solution (B = (A==v[0]) + (A==v[1])) may actually be the best one.