Distance beetween lists in Python 3
<p>Python 3.4</p>

<p>I have many lists, like that:</p>

<pre><code>A=[(1,2),(3,4),..]
...
N=[(10,2),(3,4),...]
</code></pre>

<p>I want to merge the lists, if exist minimum distance (between their points) &lt; 10.</p>

<p>measure is <code>sqrt((x1-x2)^2+(y1-y2)^2)</code></p>

<p>For example we have list with 3 matrix: </p>

<pre><code>L= [A, B, C] 
A=[(1,2), (3,4)]
B=[(4,5), (100,1)]
C=[(1,2),(3,6)]
</code></pre>

<p>AFTER(we merger A and C because they are close): </p>

<pre><code>L=[[(1,2),(3,4),(1,2),(3,6)],[(4,5),(100,1)]]
</code></pre>

<p>But how?</p>

<p>Many thanks.</p>

<p>I suggest you look at some form of <a href="https://en.wikipedia.org/wiki/Cluster_analysis" rel="nofollow">cluster analysis</a></p>

python python-3.x