If there is a JSON file with the following structure:
{
"Person1": {
"name": "Jon",
"value1": 4,
"value2": 2
},
"Person2": {
"name": "Jane",
"value1": 12,
"value2": 3
},
}
The goal is to add a new attribute to each object in the JSON file that is calculated as value1 divided by value2. For example, this new "value3" would be 2 for the first object and 4 for the second object. The desired output should resemble the following:
{
"Person1": {
"name": "Jon",
"value1": 4,
"value2": 2,
"value3": 2
},
"Person2": {
"name": "Jane",
"value1": 12,
"value2": 3,
"value3": 4
},
}
Automating this process is necessary since it needs to be done on a large scale. What would be the best approach to accomplish this?