Given this list of dictionaries
[{'Empire:FourKingdoms:': {'US': '208', 'FR': '96', 'DE': '42', 'GB': '149'}},
{'BigFarmMobileHarvest:': {'US': '211', 'FR': '101', 'DE': '64', 'GB': '261'}},
{'AgeofLords:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'BattlePiratesHQ:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'CallofWar:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'Empire:AgeofKnights:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'Empire:MillenniumWars:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'eRepublik:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'GameofEmperors:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}},
{'GameofTrenches:': {'US': '00', 'JP': '00', 'FR': '00', 'DE': '00', 'GB': '00'}}]
and this list of row names:
['Name', 'country', '30/08/2019']
How could I arrive at this DataFrame:
Name: Empire:FourKingdoms BigFarmMobileHarvest AgeofLords ...
0 Country: US FR DE GB US FR DE GB US JP FR DE GB
1 30/08/2019: 208 96 42 149 211 101 64 261 00 00 00 00 00 ...
each Country and 30/08/2019 value would have its own cell in the DataFrame. But they should be placed under each Game. Not sure if this is possible when dicts are different lengths.
My initial idea was to get the dicts out of the list, convert to DataFrame (somehow) in the desired way, and add the row names later. I'm thinking some transposing has to find place.
Another idea is to make dict keys column names and go from there.
Eventually, this would have to be printed to an excel sheet.
I looked at previous questions, but not sure if it could apply in my case.