How can be the following dict (data came from an API call via JSON format):
{
"AA":[
{
"buy":10,
"hold":6,
"period":"2020-12-01",
"sell":0,
"strongBuy":6,
"strongSell":0,
"symbol":"AA"
},
{
"buy":8,
"hold":8,
"period":"2020-11-01",
"sell":0,
"strongBuy":4,
"strongSell":0,
"symbol":"AA"
},
.......
"AAPL":[
{
"buy":10,
"hold":6,
"period":"2020-12-01",
"sell":0,
"strongBuy":6,
"strongSell":0,
"symbol":"AA"
},
be converted to a table/dataframe structure:
| buy | .... | period | symbol
| 10 | .... | 01-12-2020 | AA
| 8 | .... | 01-11-2020 | AA
.......
| 10 | .... | 01-12-2020 | AAPL
Just using df = pd.DataFrame.from_dict(j,orient='index') won't work here.