Speeding up nested loop comparison
问题 I have two arrays arr1 and arr2 with sizes (90000,1) and (120000,1) . I'd like to find out if any element of axis=0 of arr1 is present on arr2 . Then write their positions on to a list and later remove them. This will ensure that none of the elements on either lists could be found on the other. For now, I'm using for loops: list_conflict=[] for i in range (len(arr1)): for j in range (len(arr2)): if (arr1[i]==arr2[j]): list_conflict.append([i,j]) fault_index_pos = np.unique([x[0] for x in list