title: How to compare sublist of list with sublist of other list that are in same list of lists
body: <p>I have <strong>a list of lists with each list having sublists</strong> for example something like the following:</p>
  
  <pre><code>mylist = [[['AB','CD'],['GH','EF'],['IJ','KL'],['']],[['CD','AB'],['EF','GH'],['KL','IJ'],['']],[['EF','GH'],['CD','AB'],['IJ','KL'],['']],...]
  </code></pre>
  
  <p>the number of lists are 1500 and each list of them has 16 sublists(the above is just an example). What I want to do is <strong>compare the sublist of the one list with the sublist of the other list</strong>, for all lists. To be more precise, I want to <strong>compare ['AB','CD'] with ['CD','AB'] and ['EF','GH'] and the first sublist of the rest of the lists</strong>. Same follows for the second sublist. I want to check if they have the same items, the order does not matter. So the ['AB','CD'] with ['CD','AB'] would be same. But then I need also to find which sublists contain the  ['EF','GH'] and do some calculations when all same sublists are together. 
  All in all, I want to check the 1st sublist of one list with the rest of the first sublists of each list and then do the same for each sublist(2nd,3rd,4th,..,15th). 
  I thought of doing something like this</p>
  
  <pre><code>for i in range(0,len(mylist)):
          for j in range(i,len(mylist)):
              if mylist[i][j]==mylist[i + 1][j]:
  </code></pre>
  
  <p>but it doesn't seem to work when I do so. It gives me:</p>
  
  <blockquote>
    <p>IndexError: list index out of range</p>
  </blockquote>
  
  <p>I do not know if my approach is right. I tried to search and understand but I could not find something relevant. </p>
  
  <p><strong>all sublists are of same length.</strong> </p>