I am trying to get the logical index of whether one column contains a row from the same row in another column:
ab boop beep bop zorp zorpfoo zip foo zip fa
To check if column b contains a row, I would like to get:
[False, True, True]
I'm trying to use this approach now, but it's slow:
df.apply(lambda row: row['a'] in row['b'], axis=1)
Is there a .str method for this?
source share