I would like to convert dictionary of Lists into Pandas dataframe. While there are many (which can lead to downvote) similar topic such as OP1,OP2, OP3, OP4, OP5, OP6, but none of the suggestion worked for me. Off all, the closes suggestion I got was from the OP7. However, the following error was shot
AttributeError: 'list' object has no attribute 'items'
The mock up dictionary that represent the actual dictionary are as below:
x_00 = [{ "brand": "Ford","model": "Mustang","year": 1964},
{ "brand": "Fx","model": "Musxxg","year": 1900},
{"brand" : "Foyy", "model": "Musyyy", "year": 2020 }]
x_01= [{ "brand": "Forr","model": "Musrr","year": 1900},
{ "brand": "Frr","model": "Musrr","year": 1955},
{"brand" : "Forr", "model": "Musrr", "year": 2025 }]
x_02= [{ "brand": "Fogg","model": "Musgg","year": 1902},
{ "brand": "Fgg","model": "Musgg","year": 1922},
{"brand" : "Fogg", "model": "Musgg", "year": 2022 }]
CombineAll=[x_00,x_01,x_02]
As per suggestion from the thread Link , the following code was realized.
df = pd.concat([pd.DataFrame.from_dict(x, orient='index') for x in CombineAll])
But as mentioned above, error was thrown out.
Really appreciate for any hint or direction to any thread that I might miss look.
I am glad to delete this thread if there is possible duplicate!