My function to update a dictionary is prohibitively slow; can anyone help me spot how I could improve it? FYI, the original dataset is a list of dictionaries. Each dictionary re