I have two dataframes of different length like those:
DataFrame A:
FirstName LastName Adam Smith John Johnson
Da
df_b_a = (pd.merge(df_b, df_a, left_on=['FirstName', 'LastName'], right_on=['First', 'Last'], how='left') .groupby(by=['First', 'Last'], as_index=False)['Value'].sum()) print(df_b_a) First Last Value 0 Adam Smith 5.7 1 John Johnson 2.5