title: How to calculate mean values grouped on another column in Pandas
body: <p>For the following dataframe:</p>
  
  <pre><code>StationID  HoursAhead    BiasTemp  
  SS0279           0          10
  SS0279           1          20
  KEOPS            0          0
  KEOPS            1          5
  BB               0          5
  BB               1          5
  </code></pre>
  
  <p>I'd like to get something like:</p>
  
  <pre><code>StationID  BiasTemp  
  SS0279     15
  KEOPS      2.5
  BB         5
  </code></pre>
  
  <p>I know I can script something like this to get the desired result:</p>
  
  <pre><code>def transform_DF(old_df,col):
      list_stations = list(set(old_df['StationID'].values.tolist()))
      header = list(old_df.columns.values)
      header.remove(col)
      header_new = header
      new_df = pandas.DataFrame(columns = header_new)
      for i,station in enumerate(list_stations):
          general_results = old_df[(old_df['StationID'] == station)].describe()
          new_row = []
          for column in header_new:
              if column in ['StationID']: 
                  new_row.append(station)
                  continue
              new_row.append(general_results[column]['mean'])
          new_df.loc[i] = new_row
      return new_df
  </code></pre>
  
  <p>But I wonder if there is something more straightforward in pandas.</p>