title: How do I count the amount of times a unique value in a dataframe meets a requirement?
body: <p>I have a total of about 9000 rows and 26 different units in the df. An example of the df is below:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">Unit</th>
  <th style="text-align: center;">Total_time</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">E271</td>
  <td style="text-align: center;">0 days 00:05:32</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to create a column with the amount of times each unit appears in the df and a separate one that counts the amount of times each unit's time is under 6 min. The new df should look like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">Unit</th>
  <th style="text-align: center;">Total_dispatches</th>
  <th style="text-align: center;">Amount_time_under</th>
  <th style="text-align: center;">Perc_success_rate</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">E271</td>
  <td style="text-align: center;">1154</td>
  <td style="text-align: center;">883</td>
  <td style="text-align: center;">76.5%</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Any help would be appreciated!</p>