Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/41/d710224608/htdocs/clickandbuilds/Obadimu/wp-content/plugins/revslider/includes/operations.class.php on line 2854

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/41/d710224608/htdocs/clickandbuilds/Obadimu/wp-content/plugins/revslider/includes/operations.class.php on line 2858

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/41/d710224608/htdocs/clickandbuilds/Obadimu/wp-content/plugins/revslider/includes/output.class.php on line 3708

Warning: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' (this will throw an Error in a future version of PHP) in /homepages/41/d710224608/htdocs/clickandbuilds/Obadimu/wp-content/themes/kalium-child/functions.php on line 73
Parsing a large JSON File – Obadimu

Parsing a large JSON File

Perspective is everything when you are experiencing the challenges of life.

Joni Eareckson Tada

I was trying to conduct an analysis on a large JSON file over the weekend and I faced several challenges with parsing the data. Eventually, I was able to figure out the solution.

I hope it helps someone in a similar situation.
import json

data_str = open('filename.json', 'r',   encoding='utf-8').read()

data = json.loads(data_str, strict=False)

You can simply loop through the data element using the keys to access the values

for y in data:
     value = y['keys']
     print(keys)

Share your thoughts