Я хочу извлечь все слова в df1, которые соответствуют df2.
df1 = pd.DataFrame(['Dog has 4 legs.It has 2 eyes.','Fish has fins','Cat has paws.It eats fish','Monkey has tail'],columns=['Description'])
df2 = pd.DataFrame(['Fish','Legs','Eyes'],columns=['Parts'])
Df1 Df2
|---------------------------------| |---------------------------------|
| **Description** | | Parts |
|---------------------------------| |---------------------------------|
| Dog has 4 legs.It has 2 eyes. | | Fish |
|---------------------------------| |---------------------------------|
| Fish has fins | | Legs |
|---------------------------------| |---------------------------------|
| Cat has paws.It eats fish. | | Tail |
|---------------------------------| |---------------------------------|
Желаемый результат:
|---------------------------------|-----------|
| **Description** |Parts |
|---------------------------------|-----------|
| Dog has 4 legs.It has 2 eyes. |Legs,Tail |
|---------------------------------|-----------|
| Fish has fins |Fish |
|---------------------------------|-----------|
| Cat has paws.It eats fish. |Fish |
|---------------------------------|-----------|
| Monkey has tail | |
|---------------------------------|-----------|