title: Apply fuzzy matching across a dataframe column and save results in a new column
body: <p>I have two data frames with each having a different number of rows. Below is a couple rows from each data set</p>
  
  <pre><code>df1 =
       Company                                   City         State  ZIP
       FREDDIE LEES AMERICAN GOURMET SAUCE       St. Louis    MO     63101
       CITYARCHRIVER 2015 FOUNDATION             St. Louis    MO     63102
       GLAXOSMITHKLINE CONSUMER HEALTHCARE       St. Louis    MO     63102
       LACKEY SHEET METAL                        St. Louis    MO     63102
  </code></pre>
  
  <p>and</p>
  
  <pre><code>df2 = 
       FDA Company                    FDA City    FDA State   FDA ZIP
       LACKEY SHEET METAL             St. Louis   MO          63102
       PRIMUS STERILIZER COMPANY LLC  Great Bend  KS          67530
       HELGET GAS PRODUCTS INC        Omaha       NE          68127
       ORTHOQUEST LLC                 La Vista    NE          68128
  </code></pre>
  
  <p>I joined them side by side using <code>combined_data = pandas.concat([df1, df2], axis = 1)</code>. My next goal is to compare each string under <code>df1['Company']</code> to each string under in <code>df2['FDA Company']</code> using several different matching commands from the <code>fuzzy wuzzy</code> module and return the value of the best match and its name. I want to store that in a new column. For example if I did the <code>fuzz.ratio</code> and <code>fuzz.token_sort_ratio</code> on <code>LACKY SHEET METAL</code> in <code>df1['Company']</code> to <code>df2['FDA Company']</code> it would return that the best match was <code>LACKY SHEET METAL</code> with a score of <code>100</code> and this would then be saved under a new column in <code>combined data</code>. It results would look like</p>
  
  <pre><code>combined_data =
       Company                                   City         State  ZIP      FDA Company                     FDA City    FDA State   FDA ZIP     fuzzy.token_sort_ratio    match    fuzzy.ratio         match
       FREDDIE LEES AMERICAN GOURMET SAUCE       St. Louis    MO     63101    LACKEY SHEET METAL              St. Louis   MO          63102       LACKEY SHEET METAL        100      LACKEY SHEET METAL  100
       CITYARCHRIVER 2015 FOUNDATION             St. Louis    MO     63102    PRIMUS STERILIZER COMPANY LLC   Great Bend  KS          67530
       GLAXOSMITHKLINE CONSUMER HEALTHCARE       St. Louis    MO     63102    HELGET GAS PRODUCTS INC         Omaha       NE          68127
       LACKEY SHEET METAL                        St. Louis    MO     63102    ORTHOQUEST LLC                  La Vista    NE          68128
  </code></pre>
  
  <p>I tried doing </p>
  
  <pre><code>combined_data['name_ratio'] = combined_data.apply(lambda x: fuzz.ratio(x['Company'], x['FDA Company']), axis = 1) 
  </code></pre>
  
  <p>But got an error because the lengths of the columns are different.</p>
  
  <p>I am stumped. How I can accomplish this?</p>