title: Group a dataframe and calculate normalised standard deviation by group?
body: <p>I've got a dataframe that looks like this:</p>
  
  <pre><code>           product  cost_per_quantity
  12779  0101010G0BB         160.788357
  12653  0101010G0BC         179.493956
  10390  0101010I0AA           0.425916
  20361  0101010I0AA           0.603650
  22504  0101010I0AA           0.633082
  </code></pre>
  
  <p>created with:</p>
  
  <pre><code>df = pd.DataFrame({ 'product': ['0101010G0BB', '0101010G0BC', '0101010I0AA', '0101010I0AA', '0101010I0AA'], 'cost_per_quantity': [160.788357, 179.493956, 0.425916, 0.603650, 0.633082]})
  </code></pre>
  
  <p>Now I want to find the products with the maximum variation in <code>cost_per_quantity</code>. </p>
  
  <p>So for example, I'd like to examine the product <code>0101010I0AA</code> and find the normalised standard deviation for <code>cost_per_quantity</code> across its three entries, and then compare it with normalised standard deviation for other products.</p>
  
  <p>What's the best way to approach this? I tried:</p>
  
  <pre><code>df1 = df.groupby('product').agg(np.std)
  </code></pre>
  
  <p>but that just gives me a bunch of <code>NaN</code>s.</p>