how do I perform a vlookup equivalent operation on my dataframe with some additional conditions
问题 HI I am trying to run lookup equivalent function on python but having tried merge and join I haven't hit the nail yet. so my first df is this list = ['Computer', 'AA', 'Monitor', 'BB', 'Printer', 'BB', 'Desk', 'AA', 'Printer', 'DD', 'Desk', 'BB'] list2 = [1500, 232, 300, 2323, 150, 2323, 250, 2323, 23, 34, 45, 56] df = pd.DataFrame(list,columns=['product']) df['number'] = list2 This is how the df would look product number 0 Computer 1500 1 AA 232 2 Monitor 300 3 BB 2323 4 Printer 150 5 BB