title: Looping through and comparing lines of two unequal length dictionaries
body: <p>I have 2 files of unequal length that each contain a column of names. I would like to use fuzzywuzzy to compare these names and identify matches. However using the script below instead of comparing all the  values in the name column in file1 to all the values in the name column in file2 it only compares the first line of file1 to all the lines of file2. Can someone please help with a script to do all pairwise comparisons? Thanks!</p>
  
  <pre><code>from fuzzywuzzy import fuzz
  from  fuzzywuzzy import process
  import csv
  
  file1_loc = 'file1.csv'
  file2_loc = 'file2.csv'
  
  file1 = csv.DictReader(open(file1_loc, 'rb'), delimiter=',', quotechar='"')
  file2 = csv.DictReader(open(file2_loc, 'rb'), delimiter=',', quotechar='"')
  
  for line in file1:
      for line2 in files2: 
          partial_ratio = fuzz.partial_ratio(str(line['NAME']), str(line2['PNODENAME'])) 
          if partial_ratio &gt; 60:
              bus_name.append(line['NAME'])
              pnode_name.append(line2['PNODENAME'])
              score_50_plus.append(partial_ratio)
              print partial_ratio 
              print line['NAME']
              print line2['PNODENAME']
  </code></pre>
  
  <p><em>Edit</em> To clarify I have a list of 218 names I'll call list1 and a list of 1172 names I'll call list2. I think that the names in list1 correspond to some of the names in list2 but they aren't exact matches so I can't do something roughly like:</p>
  
  <pre><code>matches = []
      for line in list1:
          if line in list2:
              matches.append(line)
  </code></pre>
  
  <p>Instead I'd like to get the fuzz.partial_ratio of each name in list1 to each name in list2 . Something like :</p>
  
  <pre><code>for line in list1:
      partial_ratio = fuzz.partial_ratio(line, list2[0]
  for line in list1:
      partial_ratio = fuzz.partial_ratio(line, list2[1]
  for line in list1:
      partial_ratio = fuzz.partial_ratio(line, list[2])
  </code></pre>
  
  <p>Without having to write 1172 for loops ( or 218 if I reversed it).  </p>