title: Concatenate rows of pandas DataFrame with same id
body: <p>Say I have a pandas DataFrame such as:</p>
  
  <pre><code>   A  B  id
  0  1  1   0
  1  2  1   0
  2  3  2   1
  3  0  2   1
  </code></pre>
  
  <p>Say I want to combine rows with the same id so that the other elements in the rows get put together in a list, so that the above dataframe would become:</p>
  
  <pre><code>     A       B     id
  0  [1, 2]  [1, 1]   0
  1  [3, 0]  [2, 2]   1
  </code></pre>
  
  <p>as the first two rows, and the last two rows have the same id. Does pandas have a function to do this? I am aware of the pandas groupby command, but I would like the return type to be a dataframe as well. Thanks.</p>