min_year = 2007
max_year = 2014
final_list = []
for outer in A:
    active_years = {}
for inner in outer:
    active_years[inner[0]] = inner[1]
new_outer = []
for year in range(min_year, max_year + 1):
    if year not in list(active_years.keys()):
        active_years[year] = 0
for entry in list(active_years.keys()):
    new_outer += [[entry, active_years[entry]]]
final_list += [new_outer]
print(final_list)
Insert missing dates while keeping the date order in python list