I'm try sum the specific items from two dictionaries but I get always a empty dict.
d1 = {'primary_key': '01/01/20185511', 'Fecha': '01/01/2018', 'linea': '551', 'Sentido': '1', 'trayecto': '3', 'SA_A_': '0', 'SA_B1': '1', 'SA_B2': '2', 'SA_B3': '3'}
d2 = {'primary_key': '01/01/20185511', 'Fecha': '01/01/2018', 'linea': '551', 'Sentido': '1', 'trayecto': '4', 'SA_A_': '1', 'SA_B1': '1', 'SA_B2': '2', 'SA_B3': '3'}
And result should be
{'SA_A_': '1', 'SA_B1': '2', 'SA_B2': '4', 'SA_B3': '6'}
I'm trying with
{key: int(d1.get(key, 0)) + int(d2.get(key, 0)) for key in set(d1) | set(d2) if key is not 'primary_key' and not 'Fecha' and not 'linea' and not 'Sentido' and not 'trayecto'}
But the output is
{}