Trying to convert nested JSON into columns of the current data frame. How do I accomplish this? Note: the JSON Functions list of dictionaries repeats 600+ times
{
"Functions": [
{
"CodeSha256": "",
"CodeSize":
"Description": "",
"Environment": {
"Variables": {
"COMMIT_HASH": ",
"CodeSha256": "",
"ECS_LOG_STREAM": "",
"ELASTIC_SEARCH_DOMAIN_ENDPOINT": "",
"ENVIRONMENT": "prod",
"SERVICE_NAME": "testingservicename",
"SERVICE_OWNER": "testingserviceowner",
}
},
"FunctionName": "demofunctionname",
"Timeout": ,
"TracingConfig": {
"Mode":
},
"Version": "",
"VpcConfig": {
"SecurityGroupIds": [
""
],
"SubnetIds": [
"",
"",
""
],
"VpcId": ""
}
}
] }
How I load the json
data = json.load(open('../fileservice.json'))
df = pd.DataFrame(data["Functions"])
How it appears
FunctionName Environment
0 demofunctionname {Variables{"COMMIT_HASH":"djkdkd","SERVICE_OWNER":"serviceownertest"}}
How I need it to appear
FunctionName COMMIT_HASH SERVICE_OWNER
0 demofunctionname djkdkd serviceownertest
Been trying to explode method but does not get the job done. Any suggestion or guidance is much appreciated.
pd.json_normalize()