title: Classify values in a list based on original DF (Python 3, Pandas)
body: <p>Fictional df called KW looks like this:</p>
  
  <pre><code> Group    Subgroup    Word
   orange    zebra      keys
   green     lion       mouse
   blue      horse      captain
  </code></pre>
  
  <p><strong>Code I currently have</strong> takes each of the words found under the "Word" column and replaces certain letters with other letters from a dictionary one at a time.  After this, creates a list of all these misspellings. So using the KW df: </p>
  
  <pre><code>kw = df[['Word',"Group","Subgroup"]]
  
  words = kw.to_dict()["Word"].values()
  
  md = {"m":"w","o":"z"}
  md = {k: v.split(',') for k, v in md.items()}
  
  newwords = []
  
  for word in words:
      newwords.append(word)
      for c in md:
          occ = word.count(c)
          pos = 0
          for _ in range(occ):
              pos = word.find(c, pos)
              for r in md[c]:
                  tmp = word[:pos] + r + word[pos+1:]
                  newwords.append(tmp)
              pos += 1
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>Word
  keys
  mouse
  wouse
  mzuse
  captain
  </code></pre>
  
  <p><strong>What I am trying to do</strong> is basically reclassify these misspellings into their appropriate Group/Subgroup based on the manipulated original word.  So ideally instead of spitting out a stand alone list of misspellings, it would look like this:</p>
  
  <pre><code>Group    Subgroup    Word
  orange   zebra       keys
  green    lion        mouse
  green    lion        wouse
  green    lion        mzuse
  blue     horse       captain
  </code></pre>