title: Pandas: iterate over unique values of a column that is already in sorted order
body: <p>I have constructed a pandas data frame in sorted order and would like to iterate over groups having identical values of a particular column.  It seems to me that the groupby functionality is useful for this, but as far as I can tell performing groupby does not give any guarantee about the order of the key.   How can I extract the unqiue column values in sorted order.</p>
  
  <p>Here is an example data frame:</p>
  
  <pre><code>Foo,1
  Foo,2
  Bar,2
  Bar,1
  </code></pre>
  
  <p>I would like a list ["Foo","Bar"] where the order is guaranteed by the order of the original data frame.  I can then use this list to extract appropriate rows.  The sort is actually defined in my case by columns that are also given in the data frame (not included in the example above) and so a solution that re-sorts will be acceptable if the information can not be pulled out directly. </p>