title: Replacing certain values in a column to match by another column
body: <p>I am new to Python so apologies if it comes across as a really easy question.
  I have the following example dataframe below (the real one has thousands of rows)</p>
  <pre><code>df = {'City': ['London','Tokyo','London','Paris','Paris','London','Tokyo','Tokyo', 'Paris','Berlin','Berlin','Berlin'], 
        'Code': ['367','812','367','964','964','BN611','812','Y366','Z167','L715','412','L715']}
  df = pd.DataFrame(data=df)
  </code></pre>
  <p>What I am trying to do is substitute all the instances where the code for a city starts with a letter with its numeric equivalent (for example, the code for each line where London appears should always be 367 instead of 367 and BN611).</p>
  <p>Is there a way to do this easily without having to write a code for each city separately? The dataframe I have contains a few hundred more cities and I will need to apply this to every one of them. The codes for each city are always the same (for example London always has the code 367 and BN611, etc.)</p>
  <p>Thank you</p>