I have to np.arrays, say [1, 2, 3, 4] and [1, 2]. I want to create a mask for the first one, such that for every element in the first array, if it is also in the second array, then the value is 1, else 0. Sample outputs:
a = [1, 2, 3, 4]
b = [1, 2]
m = [1, 1, 0, 0]
a = [56, 57, 58, 59]
b = [56, 58]
m = [1, 0, 1, 0]
a = [21, 22, 23]
b = [21, 22, 23]
m = [1, 1, 1]
a = [10, 11, 12]
b = []
m = [0, 0, 0]