title: Changing values with conditional and function in pandas/python
body: <p>I have a dataframe, as per the table below A. I want to create a table with the values ​​of table B.</p>
  <p>I would like to compare the next value in the row with the previous value in table A.</p>
  <p>If the next value in the row is EQUAL to the previous value in the row, apply the function (<strong>value*3</strong>) to the next value(j).</p>
  <p>If the next value is LESS than the previous one, we keep the same values.</p>
  <p>If the next value is HIGHER than the previous one, we keep the same values.</p>
  <p>TABLE A:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Bird1</th>
  <th>Bird2</th>
  <th>Bird3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>100</td>
  <td>50</td>
  <td>200</td>
  </tr>
  <tr>
  <td>100</td>
  <td>40</td>
  <td>100</td>
  </tr>
  <tr>
  <td>100</td>
  <td>40</td>
  <td>100</td>
  </tr>
  <tr>
  <td>80</td>
  <td>80</td>
  <td>200</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The result should be as per the table below. How to implement this code in python?</p>
  <p>TABLE B:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Bird1</th>
  <th>Bird2</th>
  <th>Bird3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>100</td>
  <td>50</td>
  <td>200</td>
  </tr>
  <tr>
  <td><strong>300</strong></td>
  <td>40</td>
  <td>100</td>
  </tr>
  <tr>
  <td><strong>900</strong></td>
  <td><strong>120</strong></td>
  <td><strong>300</strong></td>
  </tr>
  <tr>
  <td>80</td>
  <td>80</td>
  <td>200</td>
  </tr>
  </tbody>
  </table>
  </div>