- new_infections += [db[district][date]['new_infections']]
- weekly_sums += [db[district][date]['week_sum']]
- weekly_avgs += [db[district][date]['week_average']]
- weekly_incs += [db[district][date]['week_incidence']]
+ district_day_data = db[district][date]
+ new_infections += [district_day_data['new_infections']]
+ if 'week_sum' in district_day_data:
+ weekly_sums += [district_day_data['week_sum']]
+ if 'week_average' in district_day_data:
+ weekly_avgs += [district_day_data['week_average']]
+ if 'week_incidence' in district_day_data:
+ weekly_incs += [district_day_data['week_incidence']]