title: Fastest way of finding common elements between two list of lists in python
body: <p>I have a list as follows.</p>
  
  <pre><code>mylist = 
  [  
     [  
        [  
           "chocolate_pudding",
           920.8000000000001
        ],
        [  
           "caramel_pudding",
           345.59999999999997
        ],
        [  
           "pudding",
           248.0
        ],
        [  
           "banana_pudding",
           27.599999999999998
        ]
     ],
     [  
        [  
           "biscuits",
           190.8
        ],
        [  
           "chocolates",
           33.599999999999994
        ],
        [  
           "chocolate_pudding",
           920.8000000000001
        ]
     ],
     [  
        [  
           "tiramusu",
           145.8
        ]
     ],
     [  
        [  
           "cakes",
           139.29999999999998
        ]
     ],
     [  
        [  
           "butter_cakes",
           133.0
        ]
     ],
     [  
        [  
           "chocolate_pudding",
           920.8000000000001
        ]
     ]
  ]
  </code></pre>
  
  <p>I want to find elements that appears more than one time in the lists (e.g., <code>["chocolate_pudding", 920.8000000000001]</code>) and want to remove the repeating ones, while keeping the very first entry. </p>
  
  <p>So, my output should look like below.</p>
  
  <pre><code>mylist = 
  [  
     [  
        [  
           "chocolate_pudding",
           920.8000000000001
        ],
        [  
           "caramel_pudding",
           345.59999999999997
        ],
        [  
           "pudding",
           248.0
        ],
        [  
           "banana_pudding",
           27.599999999999998
        ]
     ],
     [  
        [  
           "biscuits",
           190.8
        ],
        [  
           "chocolates",
           33.599999999999994
        ]
     ],
     [  
        [  
           "tiramusu",
           145.8
        ]
     ],
     [  
        [  
           "cakes",
           139.29999999999998
        ]
     ],
     [  
        [  
           "butter_cakes",
           133.0
        ]
     ]
  ]
  </code></pre>
  
  <p>The code I have been trying is as follows.</p>
  
  <pre><code>mylist_copy = mylist
  
  for item in mylist:
      myindex = mylist.index(item)
      #print(item)
  
      for single_item in item:
          #print(single_item)
          for item_copy in mylist_copy:
              if mylist_copy.index(item_copy) != myindex:
                  if single_item in item_copy:
                      print(single_item)
  </code></pre>
  
  <p>Since, it has many for loops I want an efficient way of doing it. Note: I also tried;</p>
  
  <pre><code>mylist_copy = mylist
  
  for item in mylist:
      myindex = mylist.index(item)
      for item_copy in mylist_copy:
            if mylist_copy.index(item_copy) != myindex:
                  print(set(item).intersection(item_copy))
  </code></pre>
  
  <p>However, intersection does not support lists.</p>
  
  <p>Is there an easy and fast way of doing this in python?</p>