import numpy as np c = np.array(set(a).symmetric_difference(b)) #Pure numpy c = np.setdiff1d(np.union1d(a, b), np.intersect1d(a, b))