I'm trying to create a dataframe (e.g., df3) that overwrites salary information onto people's names. I currently working with df1 with a list of around 1,000 names. Here's an example of what df1 looks like.
print df1.head()
Salary
Name
Joe Smith 8700
Jane Doe 6300
Rob Dole 4700
Sue Pam 2100
Jack Li 3400
I also have df2, which randomly assigns people from df1 as either Captain and Skipper columns.
print df2.head()
Captain Skipper
Sue Pam Joe Smith
Jane Doe Sue Pam
Rob Dole Joe Smith
Joe Smith Sue Pam
Rob Dole Jack Li
How can I replace the names in df2 with their corresponding salaries so that I have this exact format below. In excel, I would use a VLOOKUP function, but I'm not sure how to accomplish this using Python.
print df3.head()
Captain Skipper
2100 8700
6300 2100
4700 8700
8700 2100
4700 3400