def sub(base, subtract):
    corrected = []
for base_dict, sub_dict in zip(base, subtract):
    corrected.append({k: (v - sub_dict.get(k, 0)) for k, v in list(base_dict.
        items())})
return corrected
Subtract values from list of dictionaries from another list of dictionaries