(This is a slightly different version of a question I asked earlier)
I have a dataframe that looks like this:
INC_KEY PTOCCUPATIONALINDUSTRY
96 170000016620 Other Services
127 170000016651 Other Services
170 170000016694 Manufacturing
181 170000016706 Construction
268 170000016793 Other Services
I also have a CSV file, which I plan to turn into a dataframe, that looks like this (assume it is a dataframe):
My task is to convert the values in PTOCCUPATIONALINDUSTRY to the numbers that you see in the dictionary. So the output should look like this:
INC_KEY PTOCCUPATIONALINDUSTRY
96 170000016620 14
127 170000016651 14
170 170000016694 2
181 170000016706 8
268 170000016793 14
What is the easiest way to do this without manually doing if statements for each value? (I'm a newbie btw).