Python Forum
Help with pandas dataframe - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Help with pandas dataframe (/thread-7559.html)



Help with pandas dataframe - saibottrenham - Jan-16-2018

Hey guys,

I have a data frame such as

dfA = 
    id                             jobtag    suc_score  
0   54                     channel manager          25
1   77                     channel manager          18
2   99                     client manager           23
3   80          corporate account manager            4
4  110                 compliance manager           25
and another dataframe such as

dfB = 
                             jobTag  occ  median_salary  suc_score
0  software development engineer iv    1              0        nan
1                   senior engineer   17              0        nan  
2     marriage and family therapist    1              0        nan  
3                           founder    1              0        nan  
4        principal network engineer    1              0        nan
what I want to do is map the suc_score from dfA to dfB based on the Jobtag
Means whenever jobtag from dfA matches jobtag from dfB I want the suc_score from the row in dfA to be added to dfB
How can I achieve that?

Cheers