I've looked at these pages: Nested Dictionary to MultiIndex pandas DataFrame (3 level) Pandas Dataframe from nested dictionary of pandas dataframes Dict of dicts of dicts to DataFrame
What I want to do is very similar to third example except I want to switch the index order (minor before major) and not have the outer index repeated. Here is my initial dictionary:
budget = {'January':{'income':{'work1':1982,'work2':1983},'expenses':{'rent':1500,'insurance':110}},
'February':{'income':{'work1':1982,'work2':1983},'expenses':{'rent':1500,'insurance':110}},
'March':{'income':{'work1':1982,'work2':1983},'expenses':{'rent':1500,'insurance':110,'other':150}},
'April':{'income':{'work1':1982,'work2':1983},'expenses':{'rent':1500,'insurance':110}},
'May':{'income':{'work1':1982,'work2':1983},'expenses':{'rent':1500,'insurance':110,'groceries':50}}
}
Desired output Excel example (but want as DataFrame):
Thanks for any help!