title: Using if to compare column values
body: <p>Here's my df, labeled &quot;Task&quot;.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th></th>
  <th>Country</th>
  <th>Confirmed</th>
  <th>Ratio</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>Austria</td>
  <td>2510071</td>
  <td>28.2</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Bolivia</td>
  <td>888175</td>
  <td>7.8</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am required to use an if-else statement to do two things: (1) determine which value in the &quot;Ratio&quot; column is greater, and (2) create a new column that says either &quot;Highest&quot; or &quot;Lowest&quot; for the appropriate observation.</p>
  <p>I've read dozens of posts about using if-else, but I cannot seem to find examples of a condition that says &quot;see if the 'Ratio' value in this row is greater or lesser than the 'Ratio' value in another row&quot;. I've made lots of if() attempts, but they've all failed pretty miserably.</p>
  <p>My goal is code that'll produce this output:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th></th>
  <th>Country</th>
  <th>Confirmed</th>
  <th>Ratio</th>
  <th>Rank</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>Austria</td>
  <td>2510071</td>
  <td>28.2</td>
  <td>Highest</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Bolivia</td>
  <td>888175</td>
  <td>7.8</td>
  <td>Lowest</td>
  </tr>
  </tbody>
  </table>
  </div>