title: Assign values to ranges in Pandas DataFrame
body: <p>Noob question. I want to assign a value to defined slices of a Pandas DataFrame, but I can't figure out from the caveats text that the error message points to how to actually do this correctly. </p>
  
  <p>Error message:
       SettingWithCopyWarning: 
       A value is trying to be set on a copy of a slice from a DataFrame</p>
  
  <p>See the the caveats in the documentation: <a href="http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy" rel="noreferrer">http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy</a></p>
  
  <p>My failing code:</p>
  
  <pre><code>df.ix[0]["points"] = 1
  df.ix[1:2]["points"] = 2
  df.ix[3:8]["points"] = 3
  </code></pre>
  
  <p>What is a proper way of doing this?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>As @Delforge comments below, the following works:</p>
  
  <pre><code>df.loc[0, ("points")] = 1
  df.loc[1:2, ("points")] = 2
  </code></pre>