four | one | three | two | |
---|---|---|---|---|
0 | abba | 1.0 | abbaa | 4.0 |
1 | bcdf | 2.0 | bbcfb | 3.0 |
2 | de | 3.0 | ccdecc | 2.0 |
3 | fg | 4.0 | ddfgddd | 1.0 |
0 True 1 False 2 True 3 True dtype: bool
Is there anyway to do this column wise, and not row wise, on a large dataset this takes exceptionally long,
?df['three'].str.contains(df['four'].str)
Thanks