title: Join rows dataframe python
body: <p>I have the following DataFrame:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>title</th>
  <th>number</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>abc</td>
  <td>3</td>
  </tr>
  <tr>
  <td>edf</td>
  <td>4</td>
  </tr>
  <tr>
  <td>abc</td>
  <td>2</td>
  </tr>
  <tr>
  <td>edf</td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How can I produce this output?
  The data is grouped by <code>title</code> column.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>title</th>
  <th>number</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>abc</td>
  <td>[3, 2]</td>
  </tr>
  <tr>
  <td>edf</td>
  <td>[4, 1]</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>To create the same dataframe I use you can use the code below:</p>
  <pre><code>import pandas as pd
  
  data = {
      &quot;title&quot;: ['abc', 'edf', 'abc', 'edf'],
      &quot;number&quot;: [3, 4, 2, 1],
  }
  
  df = pd.DataFrame(data=data)
  </code></pre>