Created
November 29, 2016 07:56
-
-
Save ShakoHo/6e1e03cb0222296c87dfddadc29385e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import copy | |
with open('test.json') as fh: | |
o = json.load(fh) | |
result = copy.deepcopy(o) | |
for case_name in o: | |
for browser_type in o[case_name]: | |
new_origin_values = [] | |
for values in o[case_name][browser_type]['origin_values']: | |
new_origin_values.append({"load": values[0], "si": values[1], "psi": values[2], "video":values[3], "ip": values[4]}) | |
result[case_name][browser_type]['origin_values'] = copy.deepcopy(new_origin_values) | |
with open('output.json', 'w+') as write_fh: | |
json.dump(result, write_fh) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment