title: Calculating average/standard deviations of rows containing certain string in pandas dataframe
body: <p>I have a large pandas dataframe read as <code>table</code>. I would like to calculate the means and standard deviations of the two different groups, <code>CRPS</code> and <code>Age</code>, so I can plot them in a bar plot with std deviations as the error bars.</p>
  
  <p>I can get the mean calculated by just the <code>Age</code> column. <strong>I figured it's a for loop that I have to construct, but I don't know how to construct further than <code>table["Age"].mean()</code>, which just gives me the average of all data points' age values. This is where I need some guidance. I want to look in the group column, tell it to calculate the average and standard deviation for the ages of that group. So, an average and standard deviation value for the ages of the <code>CRPS</code> group, for example.</strong></p>
  
  <p>I have the first 25 rows down below just to show what the dataframe looks like. I also have imported <code>numpy as np</code> as well.</p>
  
  <pre><code>        Group  Age
  0       CRPS   50
  1       CRPS   59
  2       CRPS   22
  3       CRPS   48
  4       CRPS   53
  5       CRPS   48
  6       CRPS   29
  7       CRPS   44
  8       CRPS   28
  9       CRPS   42
  10      CRPS   35
  11  CONTROLS   54
  12  CONTROLS   43
  13      CRPS   50
  14      CRPS   62
  15  CONTROLS   64
  16  CONTROLS   39
  17      CRPS   40
  18      CRPS   59
  19      CRPS   46
  20  CONTROLS   56
  21      CRPS   21
  22      CRPS   45
  23  CONTROLS   41
  24      CRPS   46
  25  CONTROLS   35
  </code></pre>