title: Extracting only the common substrings from two string columns
body: <p>I'm trying to extract every substring that two string separated by comma columns have and store the common values into a 3rd column (again by comma separated) if no common values then return 'NA'.
  I've been scouring the internet with no luck. I tried multiple solutions that I was able to find.</p>
  <p>The most recent try that I gave it was this one:</p>
  <pre><code>df1['Col_C'] = df1[df1[['Col_A', 'Col_B']].apply(lambda x : x[0]==x[1],axis=1)].reset_index(drop=True).copy()
  
  Input:
  
  Index         Col_A                    Col_B
    0    James,Harrison,Maria   Maria,Harrison,Peter,John
    1         Jim,Maria             Jimmy,Michael
    
  Desired Output:
  
  Index          Col_A                    Col_B                  Col_C
    0    James,Harrison,Maria    Maria,Harrison,Peter,John   Maria,Harrison
    1          Jim,Maria             Jimmy,Michael                 NA
  
  </code></pre>
  <p>Any recommendations would be greatly appreciated!</p>