title: How to reclassify pandas dataframe column?
body: <p>I have a Pandas dataframe that looks something like this:</p>
  
  <pre><code>&gt; print(df)
  
             image_name                       tags
  0                img1       class1 class2 class3
  1                img2                     class2
  2                img3              class2 class3
  3                img4                     class1
  </code></pre>
  
  <p>How can I reclassify the <code>tags</code> column such that any row with a <code>class3</code> value gets assigned the string "yes" and everything else the string "no"?</p>
  
  <p>I am aware that I can check for instances of a search word using the following:</p>
  
  <pre><code>df['tags'].str.contains('class3')
  </code></pre>
  
  <p>However, I am not sure how to integrate this into the task at hand.</p>
  
  <p>The following is the intended output:</p>
  
  <pre><code>           image_name                       tags
  0                img1                        yes
  1                img2                         no
  2                img3                        yes
  3                img4                         no
  </code></pre>