I am trying to find out how to make this:
I want to create the 'total sum' in df2 with a sum of all the 'value' integers from df1 for each one of my list of string in the df2 column 'agence'.
My actual list of agence is 300+ so I am looking for something where I don't have to repeat manually for each agence name.
EDIT: Sorry I thougt of adding the picture to illustrate my question because I have difficulty phrasing it, but I should also have added the reproducible example dataframes below:
import pandas as pd
df1 = pd.DataFrame({'agence': ['a', 'a, b', 'c, d, a', 'd', 'e, a', 'b, d'],
'value': [1, 4, 2, 5, 2, 10]})
df2 = pd.DataFrame({'agence': ['a', 'b', 'c', 'd', 'e',]})