title: Efficient way to find similar items in a list in Python
body: <p>I have a list of list as follows:</p>
  
  <pre><code>list_1 = [[[1,a],[2,b]], [[3,c],[4,d]], [[1,a],[5,d]], [[8,r],[10,u]]]
  </code></pre>
  
  <p>I am trying to find whether an element is this list is similar to another element. Right now, I'm looping it twice i.e. for each element, check against the rest. My output is:</p>
  
  <pre><code>[[[1,a],[2,b]], [[1,a],[5,d]]]
  </code></pre>
  
  <p>Is there a way to do this more efficiently? </p>
  
  <p>Thanks.</p>