title: Python: Multiple entries based on the same group into different columns
body: <p>I have a dataframe products. Products looks this:</p>
  
  <pre><code>Cust_ID  Prod   Time_of_Sale
  A        Bat      1 
  A        Ball     2
  A        Lego     3
  B        Lego     3
  B        Lego     9
  B        Ball     11
  B        Bat      11
  B        Bat      13
  C        Bat      2
  C        Lego     2
  </code></pre>
  
  <p>I want to change it so that it becomes like this:</p>
  
  <pre><code>Cust_ID  Bat   Bat  Ball Lego Lego
  A        1     NaN  2    3    NaN
  B        11    13   11   3    9  
  C        2     NaN  NaN  2    NaN
  </code></pre>
  
  <p>I have been playing around with <code>products.groupby()</code> and it is not really leading me anywhere. Any help is appreciated.</p>
  
  <p>The aim is to 'visualize' the order in which each item was purchased by each customer. I have more than 1000 unique Customers.</p>
  
  <p>Edit:
  I see that a user suggested that I go through <a href="https://stackoverflow.com/questions/47152691/how-to-pivot-a-dataframe">How to pivot a dataframe</a>. But this doesn't work because my columns have duplicate values.</p>