title: Python Pandas Warning: A value is trying to be set on a copy of a slice from a DataFrame
body: <p>I have a Pandas DataFrame and I would like to change all the values of a column with this code:</p>
  <pre><code>df[&quot;Population&quot;] = round(df[&quot;Population&quot;]/1000000,1)
  </code></pre>
  <p>And I receive the following warning:</p>
  <pre><code>A value is trying to be set on a copy of a slice from a DataFrame
  
  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
    return super().rename(
  &lt;ipython-input-6-59bf041bb022&gt;:2: SettingWithCopyWarning: 
  A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_indexer,col_indexer] = value instead
  
  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
    df[&quot;Population&quot;] = round(df[&quot;Population&quot;]/1000000,1)
  </code></pre>
  <p>What would be the correct way to do it and avoid such warning?</p>
  <p>Thank you for your help!</p>