I have a dataframe that outputs a Product Code:
Product Code | Price |
---|---|
61725 | $50 |
26753 | $12 |
61725 | $30 |
176534 | $10 |
How do I create a new column called "Product Name" that outputs the correct Product Name based on Product code? I have a dictionary that looks like this:
Product_Mapping = {61725:'Apples', 26753:'Cherries',176534:'Peaches'}
I want my final df to look like this:
Product Code | Price | Product Name |
---|---|---|
61725 | $50 | Apples |
26753 | $12 | Cherries |
61725 | $30 | Apples |
176534 | $10 | Peaches |