I understand merging two dataframes can be done using the below code
left2.merge(right2, left_on='keyLeft', right_on='keyRight', how='inner')
Merging process was explained in detail in this link
However, I have dataframes which have text as follows
Dataframe1
61 ability produce required documents based trans...
237 ability setup track definable error sources
440 ability log discrpeancies received vs shipped ...
1786 training education cover supply chain principl...
1931 system show estimated cost make reslotting mov...
Dataframe2
KeyWords
0 ability
1 require
2 document
3 base
4 transportation
Now I want to join the dataframes and I want the rows to be duplicated as Dataframe2 has words which can come in multiple rows of Dataframe1.
When I use a simple merge, I get a default NULL values
input_file = Dataframe2.merge(Dataframe1, left_on='KeyWords', right_on='Questions', how = 'left')
KeyWords Questions
0 ability NaN
1 require NaN
2 document NaN
3 base NaN
4 transportation NaN
How do I join so that I get the values out ? Thank you
My expected output should be like this.
KeyWords Questions
ability ability produce required documents based trans...
ability ability setup track definable error sources
ability ability log discrpeancies received vs shipped ...