I have the following code that I am trying to create a nested dictionary with. For some reason in my for loop where I have the following code `ap_dict[ap_name][cur_efr][i] = {}` this keeps getting overwritten and whatever the last number in my loop is the only value that remains in the dictionary.

Here is my full code with loops

```
ap_dict = {}
efr_data_list = [412690]
ap_names_list = ['L2']
for ap_name in ap_names_list:
    ap_dict[ap_name] = {}
    for cur_efr in efr_data_list:
        for ap in range(0, len(data['data']['stats'])):
            print('ap is {}'.format(ap))
            if data['data']['stats'][ap]['name'] == ap_name:
                a = len(data['data']['stats'][ap]['runs'])
                print('a is {}'.format(a))
                for i in range(0, len(data['data']['stats'][ap]['runs'])):
                    ap_dict[ap_name][cur_efr] = {}
                    ap_dict[ap_name][cur_efr][i] = {}
                    print('ap_dict is {}'.format(ap_dict))

```

This is what i see when the loop is in progress and is actually what I am trying to achive

```
ap_dict is {'L2': {412690: {0: {}}}}
ap_dict is {'L2': {412690: {1: {}}}}
ap_dict is {'L2': {412690: {2: {}}}}
ap_dict is {'L2': {412690: {3: {}}}}
ap_dict is {'L2': {412690: {4: {}}}}
ap_dict is {'L2': {412690: {5: {}}}}

```

This is what remains in the dict after the loop is complete

```
>>> ap_dict
    {'L2': {412690: {5: {}}}}

```