title: How to do sorting after groupby and aggregation on a Pandas Dataframe
body: <p>I'm having a Pandas Dataframe and I'm doing a groupby on two columns and have a couple of aggregate functions on a column. Here is how my code looks like</p>
  
  <pre><code>df2 = df[X,Y, Z].groupby([X,Y]).agg([np.mean, np.max, np.min]).reset_index()
  </code></pre>
  
  <p>It find the aggregate functions on the column Z.</p>
  
  <p>I need to sort by let's say <code>min</code> (i.e. <code>sort_values('min')</code>) column but it keeps complaining that 'min' column does not exist. How can I do that</p>