0

I am trying to do vlookup using pandas in python,but getting wrong result. I have two excel workbooks: First:

Share Folder name   Unnamed: 3  value2  Unnamed: 5
A                   INDIA       11      Change
B                   INDIA       15      Change
C                   INDIA       33      Change
A                   INDIA       12      Change
B                   INDIA       74      Change
A                   INDIA       740     Change

Second:

Share Folder name       email: 5
A                       abc@gmail.com
B                       bca@gmail.com
C                       gba@gmail.com

I want to do vlookup by using First and second table and want to get following result:

Share Folder name   Unnamed: 3  value2  Unnamed:5   email:5
A                   INDIA       11      Change     abc@gmail.com
B                   INDIA       15      Change     bca@gmail.com
C                   INDIA       33      Change     gba@gmail.com
A                   INDIA       12      Change     abc@gmail.com
B                   INDIA       74      Change     bca@gmail.com
A                   INDIA       740     Change     abc@gmail.com

I tried following code but didnt workded:

First.merge(Second,on='Share Folder name')
First.merge(Second, on="Share Folder name", how = 'left')

What i want is repeating values in First should get email id's corresponding to the Second table where values are not repeating.

user3420561
  • 188
  • 1
  • 2
  • 20
  • Please check dupe, e.g. by `map`. If still not working please be more specific – jezrael Dec 06 '19 at 11:46
  • your code should work in Theory, make sure that the ID's are exactly alike (no whitespace or anything) – Umar.H Dec 06 '19 at 11:50
  • Here my comparison column is share folder name and i want where ever it sees A,B,C whether there are multiple values it will automatically give email id's corresponding to each A,B,C regardless how many times it comes. – user3420561 Dec 06 '19 at 13:57

0 Answers0