Quantcast
Channel: Converting a dictionary with values as list of dictionaries into pandas DataFrame - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by jpp for Converting a dictionary with values as list of dictionaries...

Here is a solution via a dictionary comprehension:data = {'A': [{'Set1': {'Apple':1, 'Banana':2}, 'Set2': {'Orange':1}}],'B': [{'Set1': {'Apple':3, 'Banana':1, 'Carrot':2}, 'Set2': {}}],'C': [{'Set1':...

View Article



Answer by jezrael for Converting a dictionary with values as list of...

I think you need:data = {'A': [{'Set1': {'Apple':1, 'Banana':2}, 'Set2': {'Orange':1}}],'B': [{'Set1': {'Apple':3, 'Banana':1, 'Carrot':2}, 'Set2': {}}],'C': [{'Set1': {'Apple':1, 'Banana':2}, 'Set2':...

View Article

Converting a dictionary with values as list of dictionaries into pandas...

I have a Python dictionary which contains list as values corresponding to the keys. Now each list contains two another dictionaries and the data looks like this:data = {'A': [{'Set1': {'Apple':1,...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images