Python Forum

Full Version: Help with pandas dataframe
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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