title: Pandas: SettingWithCopyWarning
body: <p>I'd like to replace values in a <code>Pandas</code> <code>DataFrame</code> larger than an arbitrary number (100 in this case) with <code>NaN</code> (as values this large are indicative of a failed experiment). Previously I've used this to replace unwanted values:</p>
  
  <pre><code>sve2_all[sve2_all[' Hgtot ng/l'] &gt; 100] = np.nan
  </code></pre>
  
  <p>However, I got the following error:</p>
  
  <pre><code>-c:3: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_index,col_indexer] = value instead
  C:\Users\AppData\Local\Enthought\Canopy32\User\lib\site-packages\pandas\core\indexing.py:346: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_index,col_indexer] = value instead
  self.obj[item] = s
  </code></pre>
  
  <p>From <a href="https://stackoverflow.com/questions/20625582/how-to-deal-with-this-pandas-warning">this StackExchange question</a>, it seems that sometimes this warning can be ignored, but I can't follow the discussion well enough to be certain whether this applies to my situation. Is the warning basically letting me know that I'll be overwriting some of the values in my <code>DataFrame</code>?</p>
  
  <p>Edit: As far as I can tell, everything behaved as it should. As a follow up is my method of replacing values non-standard? Is there a better way to replace values?</p>