I´m generating a sales report since 2018 so I have two dataframes one dataframe gives the information of all the products, where It was sold, how many units and all of other type of information about the product and the other one gives the list of prices, one thing two take in consideration is that every store have a unique price for each product so I have something like these
##Dataframe 1
office | codeprod | units |
---|---|---|
001 | 12345 | 2 |
001 | 123456 | 3 |
002 | 123456 | 4 |
002 | 12345 | 5 |
##Dataframe 2
office | codeprod | price |
---|---|---|
001 | 12345 | 3.3 |
001 | 123456 | 4.5 |
002 | 123456 | 5.0 |
002 | 12345 | 3 |
What I need to do, its with both conditions office and codeprod, create a new column in my first dataframe with the price, I have tried np.where but I can´t get It done.