I have two dataframes of different lengths, data
and freqs
. freqs
contains word frequencies for nouns listed repeatedly in data
, so data
looks like:
Session Noun
1 ball
1 bath
1 bed
2 ball
2 bath
2 bed
...
and freqs looks like:
Noun Freq
ball 5177
bath 2176
bed 72681
...
I would like to add a new column to data
with word frequencies for each noun (stored in freqs
) to every corresponding row in data
. The result should look like:
Session Noun Freq
1 ball 5177
1 bath 2176
1 bed 72681
2 ball 5177
2 bath 2176
2 bed 72681
...
Is there a way to do this without manually inputting each value?