title: Unable to replace values using Dict on DataFrame column
body: <p>I am creating a dictionary <code>code_data</code> by loading a CSV file to a data frame and converting it with <code>to_dict</code> method. This is a fragment of my code:</p>
  
  <pre class="lang-py prettyprint-override"><code>path = "E:\Knoema_Work_Dataset\hrfpfwd\MetaData\MetaData_num_person.csv"
  code_data = pd.read_csv(path, usecols=['value', 'display_value'], dtype=object)
  code_data = code_data.set_index('value')['display_value'].to_dict()
  </code></pre>
  
  <p>In the following line I am attempting to replace its values:</p>
  
  <pre><code>data["Number of Deaths"] = data["Number of Deaths"].replace(code_data)
  </code></pre>
  
  <p>Sadly, it leads to an error:</p>
  
  <pre><code>Cannot compare types 'ndarray(dtype=int64)' and 'str'
  </code></pre>
  
  <p>Could you provide me with some assistance with regards to my problem?</p>