Find intersection of two columns in Python Pandas -> list of strings : <p>I would like to count how many instances of column A and B intersect.
The rows in Column A and B are lists of strings.
For example, column A may contain [car, passenger, truck] and column B may contain [car, house, flower, truck]. Since in this case, 2 strings overlap, column C should display -> 2</p>

<p>I have tried (none of these work):</p>

<pre><code>df['unique'] = np.unique(frame[['colA', 'colB']])
</code></pre>

<p>or</p>

<pre><code>def unique(colA, colB):
    unique1 = list(set(colA) &amp; set(colB))
    return unique1

df['unique'] = df.apply(unique, args=(df['colA'], frame['colB']))
</code></pre>

<p>TypeError: ('unique() takes 2 positional arguments but 3 were given', 'occurred at index article')</p>
