title: Changing value in data frame column in a loop python
body: <p>I am new to Python pandas library and using data frames.
  I am using Jupyter.
  I kind of lost with this syntax.</p>
  
  <p>I want to loop through rows and set new value to column <strong>new_value</strong>.
  I thought I would do it like this, but it raises an error.</p>
  
  <pre><code>df_merged['new_value'] = 0
  
  for i, row in df_merged.iterrows():
      df_merged['new_value'][i] = i
  </code></pre>
  
  <p>I also tried to do a calculation like:</p>
  
  <pre><code> df_merged['new_value'][i] = df_merged['move_%'] * df_merged['value']
  </code></pre>
  
  <p>But it doesnt work.</p>
  
  <p>I am getting this error:</p>
  
  <blockquote>
    <p>/usr/lib/python3.4/site-packages/ipykernel_launcher.py:4: 
        SettingWithCopyWarning: 
        A value is trying to be set on a copy of a slice from a DataFrame
         <br>See the caveats in the documentation: <a href="http://pandas.pydata.org/pandas-" rel="nofollow noreferrer">http://pandas.pydata.org/pandas-</a>
        docs/stable/indexing.html#indexing-view-versus-copy
         after removing the cwd from sys.path.</p>
  </blockquote>
  
  <p>What I am doing wrong here?  <br>
  Thanks.</p>