title: How can I get create new columns in a dataframe that will take care of spillover rows?
body: <p>I have a pandas dataframe that looks like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Name</th>
  <th>Date</th>
  <th>Item1</th>
  <th>Item2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Andrew</td>
  <td>1/1/19</td>
  <td>Apple</td>
  <td>Pear</td>
  </tr>
  <tr>
  <td>Andrew</td>
  <td>1/1/19</td>
  <td>Orange</td>
  <td></td>
  </tr>
  <tr>
  <td>John</td>
  <td>2/5/20</td>
  <td>Banana</td>
  <td></td>
  </tr>
  <tr>
  <td>Steve</td>
  <td>2/3/21</td>
  <td>Grape</td>
  <td>Apple</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The dataframe I am working with only has Item1 and Item2 columns, so if a person has a third item, a new row is created for that person with another Item1. I'd like to generate the same DataFrame, but by creating an Item3 column and keeping everything as one row per person. The result would look like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Name</th>
  <th>Date</th>
  <th>Item1</th>
  <th>Item2</th>
  <th>Item3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Andrew</td>
  <td>1/1/19</td>
  <td>Apple</td>
  <td>Pear</td>
  <td>Orange</td>
  </tr>
  <tr>
  <td>John</td>
  <td>2/5/20</td>
  <td>Banana</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>Steve</td>
  <td>2/3/21</td>
  <td>Grape</td>
  <td>Apple</td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How can I accomplish this in pandas? Note, there can be spillover of up to 5 items per person, so I'll need up to an Item5.</p>