Throwing out elements in a python list of pairs
<p>I've searched around for pointers on this question but couldn't find any. Suppose I have a list in Python:</p>

<pre><code>list = set([((3, 2), (2, 1)),
            ((3, 2), (3, 1)),
            ((3, 1), (2, 1)), 
            ((2, 1), (1,3), (2, 3))])
</code></pre>

<p>I want to refine this list so that entries of the list containing pairs with the same first element are thrown out. So for example, the output for the list above should be </p>

<pre><code>set([((3, 2), (2, 1)),
     ((3, 1), (2, 1))])
</code></pre>

<p>Because <code>((3, 2), (3, 1))</code> and <code>((2, 1), (1,3), (2, 3))</code> are elements in which at least two of the coordinate pairs have the same first entry. Is there a fast and easy way to do this? </p>

<p>As it stands, I am thinking of doing something like </p>

<pre><code>[x for x in list if ... ]
</code></pre>

<p>where I loop over the list by fixing <code>x[k][0]</code> and going through and comparing each <code>x[i][0]</code> with varying <code>i</code> to <code>x[k][0]</code>, then looping over all such <code>k</code>'s. I feel there has to be a better way to do this. Hope I was clear enough in this question, and I greatly appreciate your help. </p>
