I am getting some data from a JSON file \"new.json\", and I want to filter some data and store it into a new JSON file. Here is my code:
import json with ope
I came across this because I was trying to load a JSON file dumped from MongoDB. It was giving me an error
JSONDecodeError: Extra data: line 2 column 1
The MongoDB JSON dump has one object per line, so what worked for me is:
import json data = [json.loads(line) for line in open('data.json', 'r')]