title: Multiple Phrases Matching Python Pandas
body: <p>This is with reference to my previous question <a href="https://stackoverflow.com/questions/32273012/singular-and-plural-phrase-matching-in-pandas">Singular and plural phrase matching in pandas</a>. Since the expected functionality was not achieved from the help given by others, I am posting it with the approach I have followed and what I actually needed to achieve.</p>
  
  <p>Here below are the two phrases datasets and code.</p>
  
  <pre><code>ingredients=pd.Series(["vanilla extract","walnut","oat","egg","almond"])
  
  df=pd.DataFrame(["1 teaspoons vanilla extract","2 eggs","3 cups chopped walnuts","4 cups rolled oats","1 (10.75 ounce) can Campbell's Condensed Cream of Chicken with Herbs Soup","6 ounces smoke-flavored almonds, finely chopped","sdfgsfgsf","fsfgsgsfgfg"])
  </code></pre>
  
  <p>What I simply needed was match the phrases in the ingredients Series with the phrases in the DataFrame. As a Pseudo code, </p>
  
  <blockquote>
    <p>If ingredients(singular or plural) found in phrase in the DataFrame,
    return the ingredient. Or otherwise, return false.</p>
  </blockquote>
  
  <p>I have developed a code from instructions given in other question I asked. </p>
  
  <pre><code>results=ingredients.apply(lambda x: any(df[0].str.lower().str.contains(x.lower())))
  df["existence"]=results
  df
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uENZC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uENZC.jpg" alt="enter image description here"></a></p>
  
  <p>The problem with my code is that it only checks the number of items in the series and stop looking for it. The result I really needed is as follows,</p>
  
  <pre><code>    0                                            existence
  0   1 teaspoons vanilla extract                  vanilla
  1   2 eggs                                       egg
  2   3 cups chopped walnuts                       walnut
  3   4 cups rolled oats                           oat
  4   1 (10.75 ounce) can.....                     False
  5   6 ounces smoke-flavored almonds.....         almond
  6   sdfgsfgsf                                    False
  7   fsfgsgsfgfg                                  False
  </code></pre>
  
  <p>Can anyone tell me how should I achieve this functionality? I have spent days testing it but no luck finally. Thank You everyone. </p>