title: How to sort a DataFrame by two columns, using a custom order?
body: <p>I have a pandas DataFrame that I need to sort in a particular order in one column, and just ascending in another.
  Both columns have repeated values.
  It looks more or less like this:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame()
  df[0] = pd.Series( [ 'a', 'aa', 'c' ] * 2 )
  df[1] = pd.Series( [ 1, 2 ] * 3 )
  df[2] = pd.Series( range(6) )
  print( df )
  
      0  1  2
  0   a  1  0
  1  aa  2  1
  2   c  1  2
  3   a  2  3
  4  aa  1  4
  5   c  2  5
  </code></pre>
  
  <p>Now, say that I need to order by columns 0 and 1, but not alphabetically: Column 0 should first follow an order:</p>
  
  <pre><code>order = [ 'a', 'c', 'aa' ]
  </code></pre>
  
  <p>How do I do that?</p>
  
  <p>I would like to have it sorted like this:</p>
  
  <pre><code>print( sorted_df )
  
      0  1  2
  0   a  1  0
  1   a  2  3
  2   c  1  2
  3   c  2  5
  4  aa  1  4
  5  aa  2  1
  </code></pre>
  
  <hr>
  
  <p>Using python 3.5.2, pandas 0.18.1</p>