title: In Python, Iterate over lists (or rows in dataframe) and pass values when the column value of rows changes
body: <p>I have a dataframe with two columns (Col 1, Col2). I want to pass the values in Col 2 to a function when the col 1 value changes.
  How to accomplish ? The function will identify string similarity
  I can have them in list or dict too based on options available.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>col 1</th>
  <th>col 2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>123456</td>
  <td>Life Insurance</td>
  </tr>
  <tr>
  <td>123456</td>
  <td>Life Insuarnce</td>
  </tr>
  <tr>
  <td>789012</td>
  <td>ANZ Ltd</td>
  </tr>
  <tr>
  <td>789012</td>
  <td>AZN Ltd</td>
  </tr>
  <tr>
  <td>789012</td>
  <td>ANZ Limited</td>
  </tr>
  <tr>
  <td>13579</td>
  <td>HSCB</td>
  </tr>
  <tr>
  <td>13579</td>
  <td>HSBC</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>For rows with 123456, I have to pass values in col2(Life Insurance,Life Insuarnce), find similarity. Then, when row value changes to 789012,I have to pass the respective values in col 2 (ANZ Ltd,AZN Ltd,ANZ Limited)</p>