擅长:python、mysql、java
<p>它看起来不像<code>str.contains</code>支持多种模式,因此您可能只需要在行上应用:</p>
<pre><code>substr_matches = df.apply(lambda row: row['B'].find(row['A']) > -1, axis=1)
df.loc[substr_matches]
Out[11]:
A B
0 abc abcdef
1 abc abcdefghi
3 xyz uvwxyz
</code></pre>