One-line expression to map dictionary to another
<p>I have dictionary like</p>

<pre><code>d = {'user_id':1, 'user':'user1', 'group_id':3, 'group_name':'ordinary users'}
</code></pre>

<p>and "mapping" dictionary like:</p>

<pre><code>m = {'user_id':'uid', 'group_id':'gid', 'group_name':'group'}
</code></pre>

<p>All i want to "replace" keys in first dictionary with keys from second (e.g. replace 'user_id' with 'uid', etc.)
I know that keys are immutable and i know how to do it with 'if/else' statement.</p>

<p>But maybe there is way to do it in one line expression?</p>
