Here, you should have used 

data_names = data['names']

since 'names' is required and a KeyError should be raised if it's not there.  However, this section of the code should in any case be replaced by sequential load cals as on the line comment above.