title: Using df.column.str.contains and updating a pandas dataframe column
body: <p>I have a pandas dataframe with two columns.</p>
  
  <pre><code>df= pd.DataFrame({"C": ['this is orange','this is apple','this is pear','this is plum','this is orange'], "D": [0,0,0,0,0]})
  </code></pre>
  
  <p>I want to be able to read this C column and return in the D column the name of the fruit. So my thought process was using df.C.str.contains to determine if a certain string appears in each row of C and then D updates accordingly.The elements in C may be really long strings: ex. "This is apple which is red" but I only care if the word apple appears in the cell. I should note that i'm not tied to using str.contains but this seemed the most obvious path to me. Just not sure how I would apply it.</p>
  
  <p>The final dataframe will look like:</p>
  
  <pre><code>df= pd.DataFrame({"C": ['this is orange','this is apple','this is pear','this is plum','this is orange'], "D": ['orange','apple','pear','plum','grapefruit']})
  </code></pre>