title: How to set column values using .loc and .contains
body: <p>Both the .loc and .contains functions return a dataframe object. The pandas documentation states that to reassign a value to each row in the column, I should use .loc, but when combined with .contains I get this warning:</p>
  
  <p>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: <a href="http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy" rel="nofollow noreferrer">http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy</a></p>
  
  <p>However, the process works and I get the desired value reassignment for each row in the dataframe's column. How can I avoid this warning?</p>
  
  <pre><code>#works
  df.loc[df["matchType"]=='duo',["matchType"]]='duo'
  
  #warning thrown but still works
  df.loc[df["matchType"].str.contains('duo'),["matchType"]]='duo'
  </code></pre>