Actually, there's an even simpler solution than any of these:
import numpy as np
a = array([1,2,3,4,5,6])
b = array([1,4,5])
c = np.in1d(a,b)
The resulting c is then:
array([ True, False, False, True, True, False], dtype=bool)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…