I have the following dictionary:
{0: 'group',
1: 'still',
2: 'earnings',
3: 'shares',
4: 'make',
5: 'finally',
6: 'amazon',
7: 'deals',
8: 'comes',
9: 'york',
10: 'iphones'}
print(df)
0 1 2 ... 53 54 55
0 Group still shares ... deals york iphones
1 amazon shares make ... finally iphones earnings
...
The latter obtained from stripping an article with:
df = df["text_articles"].str.split(" ", expand = True)
How can I translate every row of the dataframe using the dictionary, ultimately creating:
print(final_df)
0 1 2 ... 53 54 55
0 0 1 3 ... 7 9 10
1 6 3 4 ... 5 10 2
...