title: Pandas dataframe - comparing values in other columns only for rows with matching labels in one column
body: <p>Im a little confused about how to incorporate if, then statements into dataframes.
  DF:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>name</th>
  <th>date1</th>
  <th>date2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>2018-08-24</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2018-08-25</td>
  <td>2018-08-24</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2017-08-25</td>
  <td>2018-08-24</td>
  </tr>
  <tr>
  <td>A</td>
  <td>2016-08-25</td>
  <td>2018-08-24</td>
  </tr>
  <tr>
  <td>B</td>
  <td>2018-08-25</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>C</td>
  <td>2018-08-25</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>C</td>
  <td>2015-04-25</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>C</td>
  <td>2018-06-25</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>C</td>
  <td>2008-06-25</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>D</td>
  <td>2018-06-25</td>
  <td>2019-09-24</td>
  </tr>
  <tr>
  <td>D</td>
  <td>2008-06-25</td>
  <td>2019-09-24</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to first compare the values in column, 'name'. If these values are the same, I want to proceed with a calculation for the other two columns.
  For example, the first two rows have the same string in 'name', so I want to proceed evaluating if date2-date1 overlaps between the first row and second row.<br />
  What is the best way to approach this?</p>