title: Pandas - Check if a column label exists in another column's value and update the column
body: <p>I have a long list of glossary word and would like to check if in a passage contains the glossary and mark 1 as yes, 0 as no, simplify as below:</p>
  
  <pre><code>&gt;&gt;&gt; glossary = ['phrase 1', 'phrase 2', 'phrase 3']
  &gt;&gt;&gt; glossary
  ['phrase 1', 'phrase 2', 'phrase 3']
  
  &gt;&gt;&gt; df= pd.DataFrame(['This is a phrase 1 and phrase 2', 'phrase 1', 
  'phrase 3', 'phrase 1 &amp; phrase 2. phrase 3 as well'],columns=['text'])
  &gt;&gt;&gt; df
                                  text
  0        This is a phrase 1 and phrase 2
  1                               phrase 1
  2                               phrase 3
  3  phrase 1 &amp; phrase 2. phrase 3 as well
  </code></pre>
  
  <p>Concatenate it as below:</p>
  
  <pre><code>                                    text  phrase 1  phrase 2  phrase 3
  0        This is a phrase 1 and phrase 2       NaN       NaN       NaN
  1                               phrase 1       NaN       NaN       NaN
  2                               phrase 3       NaN       NaN       NaN
  3  phrase 1 &amp; phrase 2. phrase 3 as well       NaN       NaN       NaN
  </code></pre>
  
  <p>I want to achieve for each of the glossary columns to compare with the text columns and update 1 if the glossary is in the text and 0 if not, in this case it would be </p>
  
  <pre><code>                                    text  phrase 1  phrase 2  phrase 3
  0        This is a phrase 1 and phrase 2       1       1       0
  1                               phrase 1       1       0       0
  2                               phrase 3       0       0       1
  3  phrase 1 &amp; phrase 2. phrase 3 as well       1       1       1
  </code></pre>
  
  <p>Can you please advise how can i achieve it? Given that in my dataframe the glossary columns are around 3000 columns so I also want to generalise the logic such that it is based on the column label as a key to compare the corresponding text in each row.</p>