title: Python dataframe with date (dates and events)
body: <p>Using PYTHON, I am trying to sort the values in the table based on dates and the associated events. Date1 and event1 are a pair because event1 occurred on date1. The same for other dates and events.
  date1 is in a column of its own, and event1 is also in its own separate column.</p>
  <p>For example, the table would include as below:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">date1</th>
  <th>event1</th>
  <th>date2</th>
  <th>event2</th>
  <th>date3</th>
  <th style="text-align: right;">event3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">March 6, 2021</td>
  <td>eventC</td>
  <td>Jan. 1, 2020</td>
  <td>eventX</td>
  <td>May 11, 2020</td>
  <td style="text-align: right;">eventB</td>
  </tr>
  <tr>
  <td style="text-align: left;">Dec. 6, 2021</td>
  <td>eventBB</td>
  <td>Feb. 11, 2001</td>
  <td>eventYY</td>
  <td>June 13, 1990</td>
  <td style="text-align: right;">eventSS</td>
  </tr>
  <tr>
  <td style="text-align: left;">March 16, 2019</td>
  <td>eventCD</td>
  <td>Jan. 1, 1998</td>
  <td>eventRE</td>
  <td>May 23, 1989</td>
  <td style="text-align: right;">eventDF</td>
  </tr>
  <tr>
  <td style="text-align: left;">Nov. 1, 2008</td>
  <td>eventCC</td>
  <td>April 14, 2001</td>
  <td>eventWQ</td>
  <td>March 17, 1999</td>
  <td style="text-align: right;">eventCV</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like the result to show as follows where for each row, sort the data from oldest date to the newest, but the order of the events follow their respective dates (e.g. eventC that occurred on March 6, 2021 as the first in row 0 is now reordered to be the third in row 0).</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">date1</th>
  <th>event1</th>
  <th>date2</th>
  <th>event2</th>
  <th>date3</th>
  <th style="text-align: right;">event3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Jan. 1, 2020</td>
  <td>eventX</td>
  <td>May 11, 2020</td>
  <td>eventB</td>
  <td>March 6, 2021</td>
  <td style="text-align: right;">eventC</td>
  </tr>
  <tr>
  <td style="text-align: left;">June 13, 1990</td>
  <td>eventSS</td>
  <td>Feb. 11, 2001</td>
  <td>eventYY</td>
  <td>Dec. 6, 2021</td>
  <td style="text-align: right;">eventBB</td>
  </tr>
  <tr>
  <td style="text-align: left;">May 23, 1989</td>
  <td>eventDF</td>
  <td>Jan. 1, 1998</td>
  <td>eventRE</td>
  <td>March 16, 2019</td>
  <td style="text-align: right;">eventCD</td>
  </tr>
  <tr>
  <td style="text-align: left;">March 17, 1999</td>
  <td>eventCV</td>
  <td>Nov. 1, 2008</td>
  <td>eventCC</td>
  <td>April 14, 2001</td>
  <td style="text-align: right;">eventWQ</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like to keep the output in the table format as above! (unless there is a good reason not to...)  =)</p>
  <p>This is actually a very small version of a much larger data. Any help would be appreciated.
  Thanks to all in advance!!!</p>