title: Python: if both cells contain certain strings
body: <p>I have a dataframe:</p>
  
  <pre><code>                            name   alike
  0  I love watermelon and banana.   melon
  1  I love watermelon and banana.  banana
  2                  I love melon.   melon
  3                  I love grape.   grape
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>df.loc[df['name'].str.contains('watermelon'), 'alike'] = 'watermelon'
  print(df)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>                            name       alike
  0  I love watermelon and banana.  watermelon
  1  I love watermelon and banana.  watermelon
  2                  I love melon.       melon
  3                  I love grape.       grape
  </code></pre>
  
  <p>This is not the result I expected, I only want to change "alike" when "name" contains watermelon and "alike" contains "melon".</p>
  
  <p>I've tried in this way:</p>
  
  <pre><code>df.loc[df['name'].str.contains('watermelon') and df['alike'].str.contains('melon'), 'alike'] = 'watermelon'
  print(df)
  </code></pre>
  
  <p>The error said:</p>
  
  <pre><code>ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>