How to access a ndjson file and find the oldest person, average age, youngest person in the country. Is it possible with python or javascript only

154 views Asked by At

enter image description here

Is it possible to open with python or javascript if so, how do I access the file and find the data I want.

1

There are 1 answers

0
Tim Roberts On

You just do it, line by line.

import json
data = []
for line in open('ndjson.json'):
    data.append( json.loads(line) )