title: how to groupby duplicate values but retain other columns of the dataframe
body: <p>I want to groupby duplicate values of a dataframe column but also retain the other column of the dataframe after the groupby. 
  For example the data looks like:
  df-</p>
  
  <pre><code>id     interest   location
  1        A            X
  2        A            Y
  1        B            X
  3        C            Z
  2        D            Y
  </code></pre>
  
  <p>The output should be</p>
  
  <pre><code>id     interest      location
  1        A,B            X
  2        A,D            Y
  3        C              Z
  </code></pre>
  
  <p>The following code gives just the id and interest column however I want to get the corresponding user's location too.</p>
  
  <p><code>unique_id = df.groupby('id')['interest'].unique().reset_index()
  </code></p>