title: settingWithCopyWarning pandas setting via index
body: <p>I am trying to set the value of a column in a dataframe by selecting via an index.</p>
  
  <pre><code>myindex = (df['city']==old_name) &amp; (df['dt'] &gt;= startDate) &amp; (df['dt'] &lt; endDate)
  new_name = 'Boston2
  df['proxyCity'].ix[myindex ] = new_name
  </code></pre>
  
  <p>In the above, I want to assign the value <code>Boston2</code> in the <code>proxyCity</code> column given the condition in myindex </p>
  
  <pre><code>C:\Users\blah\Anaconda3\lib\site-packages\pandas\core\indexing.py:132: SettingWithCopyWarning: 
  A value is trying to be set on a copy of a slice from a DataFrame
  
  See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
    self._setitem_with_indexer(indexer, value)
  </code></pre>
  
  <p>What is the correct way to do what I want to do without introducing problems as outlined in the documentation. </p>
  
  <p>The answer in this link <a href="https://stackoverflow.com/questions/22546425/using-pandas-to-select-rows-conditional-on-multiple-equivalencies#22546459">using pandas to select rows conditional on multiple equivalencies</a> seems to do it the way I implemented it. </p>
  
  <p>I'm not sure what is the right way to do this. </p>