2

I have 2 2D numpy arrays as following:

a = np.array([[1, 2], [2, 3], [3, 4], [4, 4], [4, 5], [6, 7]])
b = np.array([[3, 4], [4, 5], [6, 9]])

I want to delete the elements of a which are present in b and want the following resultant 2D numpy array

Resultant 2D numpy array:
a = [[1, 2], [2, 3], [4, 4], [6, 7]]

I wasn't able to find any posts which mention using numpy.delete on 2D arrays this way. I would like to avoid for loops as they take too much time to run. I would like to reduce the time complexity as much as possible.

hulkinBrain
  • 746
  • 8
  • 28

0 Answers0