title: Pandas dataframe groupby to calculate population standard deviation
body: <p>I am trying to use groupby and np.std to calculate a standard deviation, but it seems to be calculating a sample standard deviation (with a degrees of freedom equal to 1).</p>
  
  <p>Here is a sample.</p>
  
  <pre><code>#create dataframe
  &gt;&gt;&gt; df = pd.DataFrame({'A':[1,1,2,2],'B':[1,2,1,2],'values':np.arange(10,30,5)})
  &gt;&gt;&gt; df
     A  B  values
  0  1  1      10
  1  1  2      15
  2  2  1      20
  3  2  2      25
  
  #calculate standard deviation using groupby
  &gt;&gt;&gt; df.groupby('A').agg(np.std)
        B    values
  A                    
  1  0.707107  3.535534
  2  0.707107  3.535534
  
  #Calculate using numpy (np.std)
  &gt;&gt;&gt; np.std([10,15],ddof=0)
  2.5
  &gt;&gt;&gt; np.std([10,15],ddof=1)
  3.5355339059327378
  </code></pre>
  
  <p>Is there a way to use the population std calculation (ddof=0) with the groupby statement? The records I am using are not (not the example table above) are not samples, so I am only interested in population std deviations.</p>