title: pandas get normalize values from groupby and size?
body: <p>I know that we can get normalized values from <code>value_counts()</code> of a pandas series but when we do a group by on a dataframe, the only way to get counts is through <code>size()</code>. Is there any way to get normalized values with size()?</p>
  
  <p>Example:</p>
  
  <pre><code>df = pd.DataFrame({'subset_product':['A','A','A','B','B','C','C'],
                     'subset_close':[1,1,0,1,1,1,0]})
  df2 = df.groupby(['subset_product', 'subset_close']).size().reset_index(name='prod_count')
  
  df.subset_product.value_counts()
  A    3
  B    2
  C    2
  </code></pre>
  
  <p>df2</p>
  
  <p><a href="https://i.stack.imgur.com/tEvV6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tEvV6.png" alt="enter image description here"></a></p>
  
  <p>Looking to get:</p>
  
  <pre><code>subset_product subset_close prod_count norm
  A              0            1          1/3
  A              1            2          2/3
  B              1            2          2/2
  C              1            1          1/2
  C              0            1          1/2
  </code></pre>
  
  <p>subset_product
  Besides manually calculating the normalized values as prod_count/total, is there any way to get normalized values?</p>