title: Maintaining the order of the elements in a frozen set
body: <p>I have a list of tuples, each tuple of which contains one string and two integers. The list looks like this:</p>
  
  <pre><code>x = [('a',1,2), ('b',3,4), ('x',5,6), ('a',2,1)]
  </code></pre>
  
  <p>The list contains thousands of such tuples. Now if I want to get unique combinations, I can do the <code>frozenset</code> on my list as follows:</p>
  
  <pre><code>y = set(map(frozenset, x))
  </code></pre>
  
  <p>This gives me the following result:</p>
  
  <pre><code>{frozenset({'a', 2, 1}), frozenset({'x', 5, 6}), frozenset({3, 'b', 4})}
  </code></pre>
  
  <p>I know that set is an <strong>unordered</strong> data structure and this is normal case but I want to preserve the order of the elements here so that I can thereafter insert the elements in a <code>pandas</code> dataframe. The dataframe will look like this:</p>
  
  <pre><code> Name  Marks1  Marks2
  0    a       1       2
  1    b       3       4
  2    x       5       6
  </code></pre>