title: Pandas - Fastest way to iterate 2 dataframes?
body: <p>I have 2 data frames like:</p>
  <p>df1 - (length 1500)</p>
  <pre><code>column1
  
  word299
  word448
  word678
  ...
  word1587
  </code></pre>
  <p>df2 - (length 5,000,000)</p>
  <pre><code>column2
  
  word 1
  word 2
  word 3
  ...
  word 5000000
  </code></pre>
  <p>I'm trying to map the index of a value that occurs in df1 to the index of the most similar value in df2.</p>
  <p>My code is:</p>
  <pre><code>import pandas as pd
  import jellyfish
  
  dic = {}
  
  for index, row in df1.iterrows():
      for i, r in new_df2.iterrows():
          similarity = jellyfish.jaro_distance(row.tolist()[0], r.tolist()[0])
          if similarity &gt; 0.95:`
              #only similarity value &gt; 0.95 will be e.g. 'wordx', 'word x' (x is any number)`
              dic.update({index : i})
  </code></pre>
  <p>For the length of the data frames I have this will take forever. Any way to make this faster?</p>