I currently am trying to merge lists together from two different dataframes using pandas. I am trying to get each cell in df1 merged all the cells in df2. So as an example I have the following two dataframes:
>>> df1
0 [This, is, a, sentence]
1 [this, is, another, sentence]
>>> df2
0 [this, is, also, a, sentence]
1 [this, too, is, a, sentence]
2 [this, is, very, different]
3 [another, sentence, is, this]
4 [not, much, of, anything]
I am trying to have the two cells in df1 merge with the cells in df2, to give the following output:
>>> df_merged
0 [this, is, also, a, sentence, This, is, a, sentence]
1 [this, too, is, a, sentence, This, is, a, sentence]
2 [this, is, very, different, This, is, a, sentence]
3 [another, sentence, is, this, This, is, a, sentence]
4 [not, much, of, anything, This, is, a, sentence]
>>> df2_merged
0 [this, is, also, a, sentence, This, is, another, sentence]
1 [this, too, is, a, sentence, This, is, another, sentence]
2 [this, is, very, different, This, is, another, sentence]
3 [another, sentence, is, this, This, is, another, sentence]
4 [not, much, of, anything, This, is, another, sentence]
Any ideas on how I could achieve this? They don't necessarily need to be split up into different dataframes, they could be in different columns in the same dataframe etc