How do I convert a nested dictionary into a pandas multi-indexed dataframe?
Here is an example:
dct={'outer':{}}
for i in dct:
dct[i]={'middle':{}}
for j in dct[i]:
dct[i][j]={}
for j in dct[i]:
dct[i][j]['inner']=10
print dct
which outputs:
{'outer': {'middle': {'inner': 10}}}
I want this in a pandas dataframe which looks something like this:
outer middle inner value
inner2 value
middle2 inner value
outer2 middle inner value
inner2 value
middle2 inner value
I'm aware that multi-indexing is a good way to do this but I'm not sure how to make the data frame. Can anybody give me some pointers?