Any idea how to normalize the following JSON output from an API:
{
"AA":{
"country":"US",
"currency":"USD",
"exchange":"NEW YORK STOCK EXCHANGE, INC.",
"finnhubIndustry":"Metals & Mining",
"ipo":"2016-10-18",
"logo":"",
"marketCapitalization":4348.893,
"name":"Alcoa Corp",
"phone":"14123152900",
"shareOutstanding":185.929586,
"ticker":"AA",
"weburl":"https://www.alcoa.com/global/en/home.asp"
},
"AAA":{
},
With pd.DataFrame.from_dict(json_normalize(df1), orient='columns') I get:
AA.country AA.currency AA.exchange AA.finnhubIndustry AA.ipo AA.logo AA.marketCapitalization AA.name AA.phone AA.shareOutstanding ... AAPL.exchange AAPL.finnhubIndustry AAPL.ipo AAPL.logo AAPL.marketCapitalization AAPL.name AAPL.phone AAPL.shareOutstanding AAPL.ticker AAPL.weburl
0 US USD NEW YORK STOCK EXCHANGE, INC. Metals & Mining 2016-10-18 4348.893 Alcoa Corp 14123152900 185.929586 ... NASDAQ NMS - GLOBAL MARKET Technology 1980-12-12 https://static.finnhub.io/logo/87cb30d8-80df-1... 2103973 Apple Inc 14089961010 17001.802 AAPL https://www.apple.com/
1 rows × 144 columns
But I need a format there AA.XXX is a row and new row is added for AAA.XXX

