title: Faster way to iterate over dictionary and dataframe together?
body: <p>I have a dictionary and a DataFrame with same keys/columns.
  The DataFrame, however, is missing some data, which I will fill in using the dictionary.
  This is a minimal example and my dataset is much larger. </p>
  
  <pre class="lang-py prettyprint-override"><code>mydict = {'one': ['foo', 'bar'], 'two': ['foo', 'bar']}
  mydf = pd.DataFrame({'one': ['N/A', 'bar'], 'two': ['foo', 'N/A'], 'foo': ['foo', 'bar'], 'bar': ['foo', 'bar']})
  
  def myfunc(mydict):
      for i,k in mydict.items():
              for m in k:
                  mydf[i].replace(to_replace='N/A', value=mydf[m], inplace=True)
  
  
  for f,g in mydf.iterrows():
          for h in g:
              if h != 'N/A':
                  myfunc(mydict)
  
  for i,v in mydict.items(): 
      mydf.drop(columns=v, inplace=True, errors='ignore')
  
  </code></pre>
  
  <p>When I run my function on a larger dataset, the kernel won't stop running. What would be a faster way to do this?
  I want to try to use df.apply() or vectorize the fucntion but don't know how to. The output for the example above looks like:</p>
  
  <pre><code>    one two
  0   foo foo
  1   bar bar
  </code></pre>