I am new to Python so this may be pretty straightforward, but I have not been able to find a good answer for my problem after looking for a while. I am trying to create a Pandas dataframe from a list of dictionaries.
My list of nested dictionaries is the following:
my_list = [{0: {'a': '23', 'b': '15', 'c': '5', 'd': '-1'}, 1: {'a': '5', 'b': '6', 'c': '7', 'd': '9'}, 2: {'a': '9', 'b': '15', 'c': '5', 'd': '7'}}, {0: {'a': '5', 'b': '249', 'c': '92', 'd': '-4'}, 1: {'a': '51', 'b': '5', 'c': '34', 'd': '1'}, 2: {'a': '3', 'b': '8', 'c': '3', 'd': '11'}}]
So each key in the main dictionaries has 3 values.
Putting these into a dataframe using data = pd.DataFrame(my_list)
returns something unusable, as each cell has information on a, b, c and d in it.
I want to end up with a dataframe that looks like this:
name| a | b | c | d
0 | 23 | 15 | 5 | -1
1 | 5 | 6 | 7 | 9
2 | 9 | 15 | 5 | 7
0 | 5 |249 | 92| -4
1 |51 | 5 | 34| 1
2 | 3 | 8 | 3 | 11
Is this possible?