title: How to make dataframe entries columns of their own in a pandas dataframe
body: <p>I would like to transform values from a dataframe to columns of their own within the same dataframe, so that each name entry has only one row (instead of the same entry appearing in multiple rows for different column entries). Below is an example.</p>
  <p>This is the dataframe I have:</p>
  <pre><code>    Name   Food  Grams
  0  Tammy   Fish    200
  1  Tammy   Rice    105
  2  Wenny   Rice    250
  3  Wenny   Eggs    100
  4  Wenny   Eggs     90
  5  Steve  Plums     10
  6  Steve   Eggs     90
  </code></pre>
  <p>(code for dataframe is below)</p>
  <p>And I would like to transform this to the following:</p>
  <pre><code>    Name Fish Rice Eggs Plums
  0  Tammy  200  105  NaN   NaN
  1  Wenny  NaN  250  190   NaN
  2  Steve  NaN  NaN   90    10
  </code></pre>
  <p>(The <code>NaN</code>s can also be <code>0</code>, both are fine).</p>
  <p>Note that in situations where the same person eats the same food on different occasions, the grams of food consumed are added together within the same column (e.g. with Wenny and eggs).</p>
  <p>Code for <code>df</code>:</p>
  <pre><code>data = {'Name': ['Tammy', 'Tammy', 'Wenny', 'Wenny', 'Wenny', 
          'Steve', 'Steve'],
          'Food': ['Fish', 'Rice', 'Rice', 'Eggs', 
          'Eggs', 'Plums', 'Eggs'],
          'Grams': [200, 105, 250, 100, 90, 10, 90]}
  
  df = pd.DataFrame(data, columns = ['Name', 'Food', 'Grams'])
  </code></pre>