title: Rename column values using pandas DataFrame
body: <p>in one of the columns in my dataframe I have five values:</p>
  
  <pre><code>1,G,2,3,4
  </code></pre>
  
  <p>How to make it change the name of all "G" to 1</p>
  
  <p>I tried:</p>
  
  <pre><code>df = df['col_name'].replace({'G': 1})
  </code></pre>
  
  <p>I also tried: </p>
  
  <pre><code>df = df['col_name'].replace('G',1)
  </code></pre>
  
  <p>"G" is in fact 1 (I do not know why there is a mixed naming)</p>
  
  <p>Edit:</p>
  
  <p>works correctly with:</p>
  
  <pre><code>df['col_name'] = df['col_name'].replace({'G': 1})
  </code></pre>