title: pandas: map multiple columns to one column
body: <p>I have two columns that I want to map to a single new column using the same dictionary (and return 0 if there is no matching key in the dictionary).</p>
  
  <pre><code>&gt;&gt; codes = {'2':1,
              '31':1,
              '88':9,
              '99':9}
  
  &gt;&gt; df[['driver_action1','driver_action2']].to_dict()    
  {'driver_action1': {0: '1',
    1: '1',
    2: '77',
    3: '77',
    4: '1',
    5: '4',
    6: '2',
    7: '1',
    8: '77',
    9: '99'},
   'driver_action2': {0: '31',
    1: '99',
    2: '31',
    3: '55',
    4: '1',
    5: '5',
    6: '99',
    7: '2',
    8: '4',
    9: '99'}}
  </code></pre>
  
  <p>I thought that I could just do:</p>
  
  <pre><code>&gt;&gt; df['driver_reckless_remapped'] = df[['driver_action1','driver_action2']].applymap(lambda x: codes.get(x,0))
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>  driver_action1 driver_action2   driver_reckless_remapped
  0              1             31                          1
  1              1             99                          9
  2             77             31                          1
  3             77             55                          0
  4              1              1                          0
  5              4              5                          0
  6              2             99                          1
  7              1              2                          1
  8             77              4                          0
  9             99             99                          9
  </code></pre>
  
  <p>But instead I get:</p>
  
  <pre><code>TypeError: ("'dict' object is not callable", 'occurred at index driver_action1')
  </code></pre>
  
  <p>Is there no way to map multiple columns to one new column?</p>