I have the following 2 dataframes
df1
INDEX Staff_Name Department
1 Employee1 Department1
2 Employee2 Department1
3 Employee3 Department2
4 Employee4 Department3
5 Employee5 Department2
df2
INDEX Staff_Name
1 Employee1
2 Employee4
3 Employee10
4 Employee1
5 Employee3
I am trying to write some code that will loop through the values in df2.Staff_Name, look for a match in df1.Staff_Name and return the value of df1.Department into a new column in df2, leaving the value null if no match can be found.
I am new to Pandas, and Python in general, and I'm not sure of the syntax for what is essentially a vlookup?