title: Map partial string from dictionary in Pandas
body: <p>I like to map partial strings from dictionary keys to a Series like this:</p>
  
  <pre><code>df = pd.DataFrame(np.random.randint(0,10,size=(5, 1)), columns=list('A'))
  df.insert(0, 'n', ['abcde Germany fffe','aaaa Norway bbbb',
                     'tttt Sweden','Croatia dfdfdf','Italy sfsd'])
  
  &gt;&gt;&gt; df
  
      n                   A
  0   abcde Germany fffe  2
  1   aaaa Norway bbbb    1
  2   tttt Sweden         4
  3   Croatia dfdfdf      1
  4   Italy sfsd          2
  
  d = {'Germany':0.5, 'Croatia':1.5, 'Italy':1.5}
  </code></pre>
  
  <p>Now I like to map d's keys to the n column to match partial strings and set the multiple. I achieved this by an ugly loop:</p>
  
  <pre><code>df['multiple'] = 1
  for k, v in d.iteritems():
      df['multiple'] = np.where(df['n'].str.contains(k), v, df['multiple'])
  
  &gt;&gt;&gt; df
  
      n                   A   multiple
  0   abcde Germany fffe  2   0.5
  1   aaaa Norway bbbb    1   1.0
  2   tttt Sweden         4   1.0
  3   Croatia dfdfdf      1   1.5
  4   Italy sfsd          2   1.5
  </code></pre>
  
  <p>I there a better, more Pandasly way? Thanks!</p>