title: Fuzzy String Matching in Python using weightings
body: <p>I have Salesforce Records that I want to dedupe using fuzzy string matching techniques with weighting across different fields.</p>
  <p>I want to set up scenarios such as weightings on specific columns in the row that increase or decrease the overall similarity metric. Essentially changing the weighting allow me to prioritize my columns at different levels.</p>
  <p>I describe scenarios as a set of rules for how I want to compare records.</p>
  <p>Below is an example data set:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">First</th>
  <th style="text-align: left;">Last Name</th>
  <th>Email</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Matt</td>
  <td style="text-align: left;">Metro</td>
  <td>name@example.com</td>
  </tr>
  <tr>
  <td style="text-align: left;">Alex</td>
  <td style="text-align: left;">Two</td>
  <td>Three</td>
  </tr>
  <tr>
  <td style="text-align: left;">Matthew</td>
  <td style="text-align: left;">Meos</td>
  <td>name@example.com</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>In this scenario we have 3 features for each row of data.</p>
  <p>Each Feature has a weight of 10, this giving me a total score of 30</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Feature</th>
  <th style="text-align: left;">Score</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Fist Name</td>
  <td style="text-align: left;">10</td>
  </tr>
  <tr>
  <td style="text-align: left;">Last Name</td>
  <td style="text-align: left;">10</td>
  </tr>
  <tr>
  <td style="text-align: left;">Email</td>
  <td style="text-align: left;">10</td>
  </tr>
  <tr>
  <td style="text-align: left;">TOTAL</td>
  <td style="text-align: left;">30</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Thus an exact matching across all three fields would yield a 30 / 30 (i.e. 100% similarity score)</p>
  <p>Now lets say I want to the weighting of email to be 3 times more powerful. The model should look like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Feature</th>
  <th style="text-align: left;">Score</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Fist Name</td>
  <td style="text-align: left;">10</td>
  </tr>
  <tr>
  <td style="text-align: left;">Last Name</td>
  <td style="text-align: left;">10</td>
  </tr>
  <tr>
  <td style="text-align: left;">Email</td>
  <td style="text-align: left;">30</td>
  </tr>
  <tr>
  <td style="text-align: left;">TOTAL</td>
  <td style="text-align: left;">50</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Thus, an exact match with email, would hold significantly more weight in the similarity score.</p>
  <p>I am trying to figure out the Python Packages that can help me achieve this dynamic weighting and the algorithm I should use for similarity.</p>
  <p>For the Algorithm, I was thinking of using</p>
  <ul>
  <li>Levenshtein Distance</li>
  </ul>
  <p>For the Weightings of different fields between records:</p>
  <ul>
  <li>Python Data Frame</li>
  </ul>
  <p>What is the most performant way for achieving this this type of fuzzy string matching in Python?</p>