title: How to map/assign/replace values of one dictionary to another dictionary?
body: <p>Say I have the following 3 dictionaries:</p>
  
  <pre><code>General case:
  
  d1 = {'c_choice1': '1.10', 'c_choice2': '1.20',...}
  d2 = {'John': {'strength': 'choice1', 'agility': 'choice2',...},...}
  d3 = {'John': {'choice1': 'c_choice1', 'choice2': 'c_choice2',...},...}
  
  d2 and d3 can be:
  
  d2 = {'John': {'strength': 'choice1', 'agility': 'choice2'}, 'Kevin': {'int': 'choice1'}}
  d3 = {'John': {'choice1': 'c_choice1', 'choice2': 'c_choice2'}, 'Kevin': {'choice1': 'c_choice1'}}
  
  or
  
  d2 = {'John': {'strength': 'choice1', 'agility': 'choice1'}}
  d3 = {'John': {'choice1': 'c_choice1'}}
  </code></pre>
  
  <p>What I want to do (using general case as example):</p>
  
  <p>a) from d3, let choice1 = c_choice1, choice2 = c_choice2, etc.</p>
  
  <pre><code>choice1 = c_choice1
  choice2 = c_choice2
  </code></pre>
  
  <p>b) lookup d1 and find the value for c_choice1, c_choice2, etc.</p>
  
  <pre><code>c_choice1 = 1.10
  c_choice2 = 1.20
  </code></pre>
  
  <p>c) create a final dictionary with choice1, choice2, etc in d2 replaced with the value in d1</p>
  
  <p>My desired output (using general case as example):</p>
  
  <pre><code>d4 = {'John': {'strength': '1.10', 'agility': '1.20',...}...}
  </code></pre>
  
  <p>Note:</p>
  
  <p>a) the 3 dictionaries are created when extracting the data from a input file, the keys and values are not defined by myself, hence I do not know the order of the keys and values in the dictionaries.</p>
  
  <p>b) I am using Python 2.7.</p>
  
  <p>How am I supposed to do this?</p>