title: Creating a dictionary for each customer number in a dataframe
body: <p>I have the following data of customer interactions</p>
  
  <pre><code>customer  interacted  
  c1           i1  
  c1           i2  
  c1           i1  
  c2           i3  
  c2           i1
  </code></pre>
  
  <p>I want to convert this data frame into another dataframe with one column as customer and the second column is a dictionary which stores the interaction history. </p>
  
  <p>The second df should come like  </p>
  
  <pre><code>customer   interhist
  
      c1     {'i1': 2, 'i2': 1}  
      c2     {'i3':1, 'i1':1}
  </code></pre>