 <p>you could try something like </p> <pre><code>B.x.where(B.x.str.contains(A.x), B.index, axis=index) #this would give you the ones that don't match B.x.where(B.x.str.match(A.x, as_indexer=True), B.index, axis=index) #this would also give you the one's that don't match. You could see if you can use the "^" operator used for regex to get the ones that match. </code></pre> <p>You could also maybe try</p> <pre><code>np.where(B.x.str.contains(A.x), B.index, np.nan) </code></pre> <p>also you can try:</p> <pre><code>matchingmask = B[B.x.str.contains(A.x)] matchingframe = B.ix[matchingmask.index] #or matchingcolumn = B.ix[matchingmask.index].x #or matchingindex = B.ix[matchingmask.index].index </code></pre> <p>All of these assume you have the same index on both frames (I think)</p> <p>You want to look at the string methods: <a href="http://pandas.pydata.org/pandas-docs/stable/text.html#text-string-methods" rel="nofollow">http://pandas.pydata.org/pandas-docs/stable/text.html#text-string-methods</a></p> <p>you want to read up on regex and pandas where method: <a href="http://pandas.pydata.org/pandas-docs/dev/indexing.html#the-where-method-and-masking" rel="nofollow">http://pandas.pydata.org/pandas-docs/dev/indexing.html#the-where-method-and-masking</a></p>