The json structure
{
"categories": [{
"supercategory": "Bottle",
"id": 1,
"name": "Bottle"
},
{
"supercategory": "Car",
"id": 2,
"name": "Car"
}]
}
Is read by the following python script:
with open('file.json') as json_data:
json_info = json.load(json_data)
At some later point, the same script tries to access the data structure in the following way:
json_info['1']['name']
json_info['2']['name']
Where the numbers refer to the "id" field in the json structure. Since that code is obviously inconsistent with the json structure: How do I have to change the json structure to make that work? (Assuming I can't change the script).