I am trying to compare two Dataframes using a sub-string in one column with another Dataframe.
Given below is how my data looks like:
Dataframe 1
prod_name, prod_id, prod_category
prod_1, cate_1000101, category_1
prod_2, cate_123001, category_2
prod_3, cate_900, category_3
prod_4, cate_808, category_4
Dataframe 2
bill_id, bill_date, prod_ref
101, 2021-01-01, 3001
102, 2021-01-01, 5001
103, 2021-01-01, 8080
I am trying to compare if any part of prod_id from Dataframe 1 is available in prod_ref in Dataframe 2
Expected output:
prod_name, prod_id, bill_id, bill_date, prod_ref
prod_2, cate_123001, 101, 2021-01-01, 3001
prod_4, cate_808, 103, 2021-01-01, 8080
prod_refa string column?prod_ref=5001could also get matched with anyprod_idcontaining1, e.g.prod_id=cate_1000101