title: Create New Pandas Column from Groupby and Dividing Other Columns
body: <p>I have a Dataframe <code>df</code> like:</p>
  
  <pre><code>    Name     Date Item  Quantity  Unit_Cost  Value
  0   Clay  2018_Q1   AA         9       8.97  80.73
  1   Clay  2018_Q1   BB         3      12.34  37.02
  2   Clay  2018_Q1   CC         4       1.40   5.60
  3   Clay  2018_Q1   DD         7       0.22   1.54
  4    Ray  2018_Q1   AA         8       5.30  42.40
  5    Ray  2018_Q1   DD         2       1.60   3.20
  6    Ray  2018_Q1   EE         4       8.00  32.00
  7    Ray  2018_Q1   FF         9       4.00  36.00
  8   Clay  2018_Q2   DD         1       0.45   0.45
  9   Clay  2018_Q2   AA         4       7.00  28.00
  10  Clay  2018_Q2   EE         2       6.40  12.80
  11  Clay  2018_Q2   CC         3       2.30   6.90
  12   Ray  2018_Q2   CC         1       9.00   9.00
  13   Ray  2018_Q2   DD         4       8.00  32.00
  14   Ray  2018_Q2   GG         1       6.50   6.50
  15   Ray  2018_Q2   HH         2       9.10  18.20
  </code></pre>
  
  <p>nd I want to calculate a new column called <code>% of Total Value</code>, which will be the:</p>
  
  <p>(<code>Value</code> for a given <code>Date</code> <code>Name</code>, and <code>Item</code>) / (<code>sum</code> of all <code>Values</code> for that <code>Date</code> and <code>Name</code>). </p>
  
  <p>So output would look like: </p>
  
  <pre><code>    Name     Date Item  Quantity  Unit_Cost  Value  % of Total Value
  0   Clay  2018_Q1   AA         9       8.97  80.73          0.646409
  1   Clay  2018_Q1   BB         3      12.34  37.02          0.296421
  2   Clay  2018_Q1   CC         4       1.40   5.60          0.044839
  3   Clay  2018_Q1   DD         7       0.22   1.54          0.012331
  4    Ray  2018_Q1   AA         8       5.30  42.40          0.373239
  5    Ray  2018_Q1   DD         2       1.60   3.20          0.028169
  6    Ray  2018_Q1   EE         4       8.00  32.00          0.281690
  7    Ray  2018_Q1   FF         9       4.00  36.00          0.316901
  8   Clay  2018_Q2   DD         1       0.45   0.45          0.009346
  9   Clay  2018_Q2   AA         4       7.00  28.00          0.581516
  10  Clay  2018_Q2   EE         2       6.40  12.80          0.265836
  11  Clay  2018_Q2   CC         3       2.30   6.90          0.143302
  12   Ray  2018_Q2   CC         1       9.00   9.00          0.136986
  13   Ray  2018_Q2   DD         4       8.00  32.00          0.487062
  14   Ray  2018_Q2   GG         1       6.50   6.50          0.098935
  15   Ray  2018_Q2   HH         2       9.10  18.20          0.277017
  </code></pre>
  
  <p>I have tried something like:</p>
  
  <pre><code>quarter_total_value = df.groupby(['Name', 'Date'])['Value'].sum()
  
  df['% of Total Value'] = df['Value']/quarter_total_value
  </code></pre>
  
  <p>but that gives me an error:</p>
  
  <pre><code>ValueError: cannot join with no overlapping index names
  </code></pre>
  
  <p>So how can I achieve the desired output? Do I have to iterate over the <code>df</code> and write each <code>% of Total Value</code> or is there an easier way of doing this? </p>