title: Country Data: Renaming countries according to dict in pandas
body: <p>Hej!</p>
  
  <p>I am working on some data analysis of country statistics. I now use data from different sources, and as soon has been seen, countries get called differently some times: while the World Bank calls it "United Kingdom and Northern Ireland", the WHO might call it simply "United Kingdom" and mean the same political construct (I am aware of the fact that England, Scotland and Wales are the "countries" not really UK).</p>
  
  <p>I created a dictionary where I took most of the different names to standardise it to World Bank Data. This works like a charm in a list, but I need it in a pandas DataFrame, that I get from <code>pd.read_csv</code>.
  In example: If I have a very short dictionary</p>
  
  <pre><code>dict = {'US': 'USA'}
  </code></pre>
  
  <p>how can I translate this within my dataframe (set the column in <code>df.country</code> to the <code>dict.key</code> value)?</p>
  
  <p>Showing it in example:</p>
  
  <pre><code>ID  country   val
  1   US        some values
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>ID  country  val
  1   USA      some values
  </code></pre>
  
  <p>For my list conversion I used the following construct, where <code>listB</code> is the input and output list:</p>
  
  <pre><code>for key in dict:
      listB = [w.replace(key, dict[key]) for w in listB]
  </code></pre>
  
  <p>Any suggestions how to do this the most easily? Any help would be awesome!</p>
  
  <p>P.S: On a further note, does anyone have an idea how to generate ISO 3166-1 alpha-3 codes (like Germany = GER, Sweden = SWE and so on?). That might be an extension of the question above.</p>