I have a dataframe with text column
| Text |
|---|
| I need a new umbrella |
| I need new shoes |
I have created a dictionary like this
dict = {'umbrella': '1','shoes':2}
I want my output dataframe to look like this
| Text | Value |
|---|---|
| I need a new umbrealla | 1 |
| I need new shoes | 2 |
It should look for keys in a dictionary and populate the corresponding value against the row in a dataframe.
Can somebody suggest how to do it in python?