title: Compare two dataframe columns for matching strings or are substrings then count in pandas
body: <p>I have two dataframes (A and B). I want to compare strings in A and find a match or is contained in another string in B. Then count the amount of times A was matched or contained in B.</p>
  <pre><code>    Dataframe A
   
  0   &quot;4012, 4065, 4682&quot;
  1   &quot;4712, 2339, 5652, 10007&quot;
  2   &quot;4618, 8987&quot;
  3   &quot;7447, 4615, 4012&quot;
  4   &quot;6515&quot;
  5   &quot;4065, 2339, 4012&quot;
  
  
      Dataframe B
  
  0   &quot;6515, 4012, 4618, 8987&quot;         &lt;- matches (DF A, Index 2 &amp; 4) (2: 4618, 8987), (4: 6515)
  1   &quot;4065, 5116, 2339, 8757, 4012&quot;   &lt;- matches (DF A, Index 5) (4065, 2339, 4012)
  2   &quot;1101&quot;
  3   &quot;6515&quot;                           &lt;- matches (DF A, Index 4) (6515)
  4   &quot;4012, 4615, 7447&quot;               &lt;- matches (DF A, Index 3) (7447, 4615, 4012)
  5   &quot;7447, 6515, 4012, 4615&quot;         &lt;- matches (DF A, Index 3 &amp; 4) (3: 7447, 4615, 4012 ), (4: 6515)
  
  
      Desired Output:
  
      Itemset             Count
  
  2   4618, 8987            1
  3   7447, 4165, 4012      2
  4   6515                  3
  5   4065, 2339, 4012      1
  </code></pre>
  <p>Basically, I want to count when there is a direct match of A in B (either in order or not) or if A is partially contained in B (in order or not). My goal is to count how many times A is being validated by B. These are all strings by the way.</p>