title: Pandas dataframe row reduction/compression (for rows having the same value)
body: <p>I have a df such as:</p>
  
  <pre><code>seed  value
   1      2 
   1      3
   1      4
   2      20
   2      60
  </code></pre>
  
  <p>would like to get a shorter dataframe (df_short) with the average value for same seeds, such as</p>
  
  <pre><code>seed  value   
    1     3        
    2     40
  </code></pre>
  
  <p>tried df.groupby("seed"), seems working, though I am getting a DataFrameGroupBy object, which I cannot use as a dataframe. Then from the question <a href="https://stackoverflow.com/questions/13582449/convert-dataframegroupby-object-to-dataframe-pandas">Convert DataFrameGroupBy object to DataFrame pandas</a>, I tried the following:</p>
  
  <pre><code>from pandas import *
  
  df = DataFrame({'seed' : [1 ,1, 1, 2, 2],
                 'value' : [2, 3, 4, 20, 60]})           
  df_short=df.groupby('seed').aggregate(np.mean)
  print df_short        #works as expected
  print df_short['seed'] #error  
  </code></pre>
  
  <p><code>print list(df_short.columns.values)</code>  should give me <code>['seed', 'value']</code></p>