title: calculate relative contribution over the total in pandas
body: <p>Hi have a df looking like:</p>
  
  <pre><code>keyword clicks
  a       20
  b       40
  c       50
  a       10
  </code></pre>
  
  <p>I want to obtain a grouped df that would contain something like the relative contribution of the percentage of keyword relative to the percentage of clicks.</p>
  
  <p>My ultimate goal is to check whether there's a Pareto relationship 
  underlying the data.</p>
  
  <p>I imagine something like: 20% of keywords contribute to the 80% of clicks, to plot the result of fraction of kw vs. fraction of clicks.</p>
  
  <p>Reproducible example is:</p>
  
  <pre><code>df = pd.DataFrame({'clicks': {0: 20, 1: 40, 2: 50, 3: 10},
  'keyword': {0: 'a', 1: 'b', 2: 'c', 3: 'a'}})
  </code></pre>