title: compare two column values and create 2 more columns based on comparison
body: <p>I have a pandas dataframe, i would require a column value to be checked if its available in another column values and create 2 more columns based on it.</p>
  
  <p>My Dataframe looks like this :</p>
  
  <pre><code>Dept-x  Country Age Category    Dept-y
  Math    India   Young   Good    Math,Social,English,Science,French
  Math    India   Adult   Good    Math,Social,English,Science,French
  Social  Aus     Young   Average Science,Math,Social, English, French
  Science Pak     Young   Good    Math,Social,English,Practical,French
  Science Pak     Adult   Average Math,Social,Science,French,English
  Science Pak     Adult   Good    Science,Math,Social, English, French
  </code></pre>
  
  <p>Expected Dataframe :</p>
  
  <pre><code>Top 3   Top all
  1             1
  1             1
  0             1
  0             0
  1             1
  1             1
  </code></pre>
  
  <p>So, in the expected dataframe in addition to the existing columns we would need to add two columns (i.e) Top 3 and Top all.</p>
  
  <p>If the value of Dept-x is available in First 3 values of Dept-y then both Top 3 and Top all should have value as 1.</p>
  
  <p>If the value of Dept-x is not available in First 3 values but exists in Dept-y then Top 3 should be 0 and Top all should be 1.</p>
  
  <p>If the value of Dept-x is not at all available in Dept-y then both Top 3 and Top all should have value a 0.</p>
  
  <p>I would appreciate if some one can help me to achieve this ?</p>