title: pandas get minimum of one column in group when groupby another
body: <p>I have a pandas dataframe that looks like this:</p>
  
  <pre><code>      c     y
  0     9     0
  1     8     0
  2     3     1
  3     6     2
  4     1     3
  5     2     3
  6     5     3
  7     4     4
  8     0     4
  9     7     4
  </code></pre>
  
  <p>I'd like to groupby <code>y</code> and get the min and max of <code>c</code> so that my new dataframe would look like this:</p>
  
  <pre><code>      c     y     min   max
  0     9     0     8     9
  1     8     0     8     9
  2     3     1     3     3   
  3     6     2     6     6 
  4     1     3     1     5
  5     2     3     1     5
  6     5     3     1     5
  7     4     4     0     7
  8     0     4     0     7
  9     7     4     0     7
  </code></pre>
  
  <p>I tried using <code>df['min'] = df.groupby(['y'])['c'].min()</code> but that gave me some weird results. The first 175 rows were populated in the min column but then it went to NaN for all the rest. is that not how you're supposed to use the groupby method?</p>