Python 如何求2组坐标的差?如果坐标的差小于或等于5,则视为相似对
在这段代码中,我找到了完全相同的角落 我的第一套是(133708),(281287),(140396),(285550) 第二组是(295315),(213552),(181643),(255396),(282552)Python 如何求2组坐标的差?如果坐标的差小于或等于5,则视为相似对,python,numpy,set,tuples,Python,Numpy,Set,Tuples,在这段代码中,我找到了完全相同的角落 我的第一套是(133708),(281287),(140396),(285550) 第二组是(295315),(213552),(181643),(255396),(282552) 第一组和第二组的差异,如果你能添加一个你想要的例子? first_set = set(map(tuple, coords)) second_set = set(map(tuple, coords1)) similar=first_set.inte
第一组和第二组的差异,如果你能添加一个你想要的例子?
first_set = set(map(tuple, coords))
second_set = set(map(tuple, coords1))
similar=first_set.intersection(second_set)
print(first_set)
print(second_set)
print(similar)