Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何求2组坐标的差?如果坐标的差小于或等于5,则视为相似对_Python_Numpy_Set_Tuples - Fatal编程技术网

Python 如何求2组坐标的差?如果坐标的差小于或等于5,则视为相似对

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

在这段代码中,我找到了完全相同的角落

我的第一套是(133708),(281287),(140396),(285550)

第二组是(295315),(213552),(181643),(255396),(282552)


第一组和第二组的差异,如果你能添加一个你想要的例子?
   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)