title: How do I re-map python dict keys
body: <p>I am working on a program that (among other things) reads a CSV file in (it gets stored as an array of dicts in the form <code>[{col1:data1a,col2:data2a},{col1:data1b,col2:data2b}]</code> ). For each row, as part of other processing, I need to remap those keys to user entered values, which are provided in another dict so they can be used as parameters in an API call.  The mapping array is in the form:  <code>{badname1:goodname1, badname2:goodname2,...}</code>.</p>
  
  <p>So I'd like to get from:</p>
  
  <pre><code>{badname1:data1, badname2:data2,...}` to `{goodname1:data1, goodname2:data2,...}
  </code></pre>
  
  <p>I'd like to use something like <code>zip()</code> (although <code>zip()</code> yields <code>{badname1:badname1,...}</code>).</p>
  
  <p>Seems like there should be an obvious solution that is alluding me.</p>
  
  <p>If the data is in <code>a</code> and the mapping in <code>b</code>:</p>
  
  <pre><code>dict(zip(b,a.itervalues()))
  </code></pre>
  
  <p>I get close, but it will only work in cases where the fields are known to be in the same order I think.</p>