title: Check if multiple columns exist in another columns pandas
body: <p>I want to run query on multiple columns (Data1, Data2) to find the values in other columns (Column1, Column2, Column3) if it exists in any of these columns (considering these columns have empty cells also)</p>
  <p>My data looks like this:</p>
  <pre><code>Column1  Column2  Column3  Data1    Data2
  sunday   monday            sunday   friday
  sunday   friday   tuesday  friday   sunday
  sunday            monday   thursday tuesday
  </code></pre>
  <p>I want the output like:</p>
  <pre><code>Column1  Column2  Column3  Data1    Exist_Data1   Data2      Exist_Data2
  sunday   monday            sunday   Yes           friday     Yes
  sunday   friday   tuesday  friday   Yes           wednesday  No
  sunday            monday   thursday  No           tuesday    Yes
  </code></pre>
  <p>I have tried the command below:</p>
  <p>pd.Series(['A', 'B']).isin(df.columns).all() (as mentioned in the <a href="https://stackoverflow.com/questions/47815140/check-if-multiple-columns-exist-in-a-df">Check if multiple columns exist in a df</a></p>
  <p>but it check in all the columns. I have modified the df.columns but doesn't seem to work either.</p>
  <p>*******UPDATE ********</p>
  <p>Editing after trying the code:</p>
  <p>As can be seen in the image below, there are some entries in Data1 and Data2 that exists in the other columns but still says &quot;No&quot;. (There are no whitespace characters - all are removed using strip()&quot; Double checked after writing the CSV and checking for spaces.</p>
  <p><a href="https://i.stack.imgur.com/eK3TH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eK3TH.png" alt="enter image description here" /></a></p>