# Json Data Manipulation Activity

**URL:** <https://club.ministryoftesting.com/t/json-data-manipulation-activity/33989>\
**Category:** Discussions\
**Tags:** python, data, python-for-testers-intro\
**Created:** [30 January 2020 19:01 UTC](https://club.ministryoftesting.com/t/json-data-manipulation-activity/33989 "2020-01-30T19:01:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davewesterveld](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/davewesterveld/32/283_2.png) [@davewesterveld](https://club.ministryoftesting.com/u/davewesterveld)\
**Post date:** [30 January 2020 19:01 UTC](https://club.ministryoftesting.com/t/json-data-manipulation-activity/33989/1 "2020-01-30T19:01:18Z")

</div>

**Time:** 20-30 minutes

**Purpose:** Give you practice with parsing .json files

**Introduction:** Try to solve the following problem. The data file that you will need to parse through can be found [here](https://github.com/djwester/pythonfortesters/blob/master/jsonperfdata.json). Try to solve this on your own before watching the solution video or looking at the solution file. Feel free to ask questions here if you find anything confusing.

**Task:**  
For this activity use the data in [jsonperdata.json](https://github.com/djwester/pythonfortesters/blob/master/jsonperfdata.json) and for each dictionary in the data section, compare the sum of averageResolve, averageConnect, averageTransfer and averageClosing to the averageTotal. If the difference between the sum of all the other averages to the average total is more than 1 second, print out the difference along with the starting time stamp.

Outputs should look something like this:

```auto
At time 2019-09-02T16:00:00Z:
The sum was 951.11 and the total was 959.82

```

Solution file for this can be seen [here](https://github.com/djwester/pythonfortesters/blob/master/json_data_manipulation_solution.py) but don’t look at this until you have tried to solve this on your own.
