Avoid permutations when searching for coincident data
<p>I have this data:</p>

<pre><code>1,           0.,           0.,        1500.
.
.     
21,           0.,        2000.,        1500.
22,           0.,        2100.,        1500.
</code></pre>

<p>which I already appended to a list called nodes: nodes[node ID, coord. x, coord. y, coord. z].</p>

<p>Now I want to find the coincident nodes. So I've tried:</p>

<pre><code>for data in nodes:
    for data2 in nodes:
        if data2[1]==data[1] and data2[2]==data[2] and data2[3]==data[3] and data[0]&lt;&gt;data2[0]:
            coincident_nodes.append((data[0],data2[0])) 
</code></pre>

<p>what happens is that I get for instance: (31, 32) and (32, 31) and I only want (31, 32) or (32, 31), just one combination.</p>

<p>Many thanks.</p>
