python - Create dataframe from nested dictionary keeping nested dictionary as column -


i have following nested dictionary , convert dataframe.

nested dictionary

the first 2 columns keys of first dictionary , third column nested dictionary.

the first 2 columns of dataframe

any suggestions? lot in advance!

that's not greatest input data, if you're confident structure of dictionary won't change, try below:

dataframe([         [x[0] x in nested_dict.keys()],         [x[1] x in nested_dict.keys()],         [x x in nested_dict.values()],     ]).t 

this should give dataframe specs.

    0           1   2 0   timestamp4  324 {326: 3} 1   timestamp3  323 {325: 2} 2   timestamp   321 {321: 0} 3   timestamp2  322 {323: 1} 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -