What is the quickest way to find matching 2-tuples in another list of 2-tuples?
The following codes looks extremely inefficient. loc1 and loc2 are list of tuples of (x,y) coordinates.
loc3=[]
for loc in loc1:
if loc in loc2:
loc3.append(loc)
I think hashing is the key but not sure how to do it on Python. Please teach me an elegant code. Thanks.