0

I am working with two 2D numpy array that have ~20k and ~30k rows. Both A and B have 270 columns. I need to find the rows that are in A but not in B. I used the code below but it is too slow.

B = np.array([x for x in A if x.tolist() not in A.tolist()])

I need a fast version of this line of code. Any thoughts are appreciated!

2
  • Please share a Minimal, Complete, and Verifiable example Commented Apr 23, 2020 at 15:10
  • Use the mask off the linked question as mask and use it with A[~mask]. Commented Apr 23, 2020 at 15:16

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.