I have been going through several solutions, but I am not able to find a solution I need.
I have two numpy arrays. Let\'s take a small example<
numpy
Simply pass the negated version of boolean array returned by np.in1d to array x:
np.in1d
x
>>> x = np.array([1,2,3,4,5,6,7,8,9]) >>> y = [3,4,5] >>> x[~np.in1d(x, y)] array([1, 2, 6, 7, 8, 9])