I am wondering if there is a python-numpy operator to compare two vectors of the same shape. Specifically, 
Can I get the results directly through a numpy API and what is it? Thanks very much!
I am wondering if there is a python-numpy operator to compare two vectors of the same shape. Specifically, 
Can I get the results directly through a numpy API and what is it? Thanks very much!
If your arrays are a and b:
c = ((np.repeat(a, b.shape[0]).reshape(a.shape[0], b.shape[0]) - b) == 0).astype(int) or, as hpaulj and FBruzzesi said:
c = (a[:, None] == b).astype(int) a[:,None]==b(a[:, None] == b).astype(int) to have zeros and ones instead of boolean values.