In SQL when I expect the text on one column to contain the text of another, I could do something like:
select *
from a inner join b on a.col like '%' + b.col '%'
Is there a way to do that in Pandas? I've seen some posts like this https://stackoverflow.com/a/50573508/3515825 where they do a join and then filter. However, I only have one criteria/column to join on and I'm not sure where to start.
Should I start with a cross join merge and then filter? Is there a more efficient way to do that?
Update here is an example:
DF A
Name Grade
Sam F. Jones A
Rick Smith B
DF B
Last Name Year
Jones 12
Smith 10
I would like to join the two data frames based on the last name being in the name. Please note, that in reality, what I'm trying to is more complicated, I can't rely too much on the structure of the "Name" column.
Thank you!