I am trying to generate a nested dict, inside another nested dict, but I could only get one step done.
Here is the code i got:
variables = ['CHG', 'Open', 'Close']
assets= ['GOOG', 'FB']
dates =['28-09-2020', '25-09-2020']
dct = {x: dict(zip(assets, '0' * len(assets))) for x in dates}
Gets me:
{'28-09-2020': {'GOOG': '0', 'FB': '0'}, '25-09-2020': {'GOOG': '0', 'FB': '0'}}
How can i generate the dict, with variables inside each asset?
My objective is to get a dict like this:
{'28-09-2020': {'GOOG': {'CHG':0, 'Open':0, 'Close':0}, 'FB': {'CHG':0, 'Open':0, 'Close':0}}, '25-09-2020': {'GOOG': {'CHG':0, 'Open':0, 'Close':0}, 'FB': {'CHG':0, 'Open':0, 'Close':0}}}