title: Delete rows between NaN and a change in the column value
body: <p>I am stuck on a problem which looks simple but for which I cannot find a proper solution.</p>
  <p>Consider a given Pandas dataframe <code>df</code>, composed by multiple columns A1,A2, etc., and let <code>Ai</code> be one of its column filled for example as follows:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Ai</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>25</td>
  </tr>
  <tr>
  <td>30</td>
  </tr>
  <tr>
  <td>30</td>
  </tr>
  <tr>
  <td>NaN</td>
  </tr>
  <tr>
  <td>12</td>
  </tr>
  <tr>
  <td>15</td>
  </tr>
  <tr>
  <td>15</td>
  </tr>
  <tr>
  <td>NaN</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like to delete all the rows in <code>df</code> for which <code>Ai</code> values are between NaN and a &quot;further change&quot; in its value, so that my output (for column <code>Ai</code>) would be:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Ai</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>25</td>
  </tr>
  <tr>
  <td>NaN</td>
  </tr>
  <tr>
  <td>12</td>
  </tr>
  <tr>
  <td>NaN</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Any idea on how to do so would be very much appreciated. Thank you very much in advance.</p>