title: Use column of list values and apply as keys to another column of dictionary values on pandas dataframe
body: <p>Say I have a dataframe called &quot;result&quot; that consists of two columns, one that has list values and the other has dictionary values like this:</p>
  <pre><code>List_Column                           
  [06052, 06710, 06513, 06604]              
  
  Program_Dict_Column
  {'06710': 'Program1', '06604': 'Program2', '06513': 'Program2', '06106': 'Program3', '06052': 'Program4', '06082': 'Program5'}
  
  </code></pre>
  <p>I'm trying to use the list column as keys (each element in list) to map to the dictionary column to create a new column that is the output values.</p>
  <pre><code>Desired Sample Output:
  ['Program4','Program1','Program2','Program2']
  </code></pre>
  <p>I can make it work for single cases by doing the following:
  example for index = 2</p>
  <pre><code>[result.Program_Dict_Column[2][i] for i in result.List_Column[2]]
  
  </code></pre>
  <p>But I can't seem to make this work for all dataframe values.</p>
  <p>I've tried:</p>
  <p>1.making a function then using lambda to apply:</p>
  <pre><code>def get_values(dics, lists):
      for k,v in dics.items():
          return [v[i] for i in lists]
  
  
  result[&quot;Desired_Programs&quot;] = result.apply(lambda x: get_values(x.Program_Dict_Column, x.List_Column),axis=1)
  </code></pre>
  <p>however I get an error: TypeError: string indices must be integers</p>
  <p>Any help would be greatly appreciated.</p>