我想检查一个数据框中的列中的值是否存在于第二个数据框的列中。如果存在,则将该值添加到第二个数据帧中同一行的新列中。所有值都是字符串值。两个数据框的大小都不同。第二个数据框也有大约 70 万条记录。所以我拥有的数据框:
DF1
THINGS
book+pen
CAR
chair
laptop
DF2
Description
I want a new book.
I will pen down this things
A quick ride in my new car.
Cars are awesome.
My laptop's memory is bad.
Maybe try sitting on that CHAIR.
我想要的输出是添加“更新”列:
Description Updated
I want a new book. book
I will pen down this things pen
A quick ride in my new car. car
Cars are awesome. car
My laptop's memory is bad. laptop
Maybe try sitting on that CHAIR. chair
Search for that book in my laptop. book+laptop
我已经尝试过蛮力方法,但处理时间太长。提前致谢!