I'm currently facing the following issue and would highly appreciate any help. My data frame looks like this
country_birth   year    migrants   live_in                gender
Albania         2000      1        Australia           male
Germany         2000      2        Australia           female
Albania         2008      3        Australia           male
Albania         2000      6        Australia           female
Germany         2004      2        Australia           female
UK               2004      2         Germany           female
US               2004      5          UK                male
Now I would like to get the sum of migrants (both gender) for the same country of birth and the same live_in country for a matching year. A new dataframe should look something like this
country_birth   year    total_migrants   live_in                
Albania         2000      7              Australia           
...             ...      ...                ...
Many thanks in advance!
 
     
     
    