nested = dict()
for row in kinetic_parameters:
    _model, outkey, inkey, val = row
if outkey not in d:
    nested[outkey] = dict()
nested[outkey][inkey] = val
How can I correct my code to produce a nested dictionary?