I have a large JSON file which looks like this :
{"details":{
"1000":[
["10","Thursday","1","19.89"],
["12","Monday","3","20.90"],
...
]
"1001":[
["30","Sunday","11","80.22"],
["88","Wednesday","22","8.29"],
...
]
}
}
Now I'm extracting the lists present in variables like "1000", "1001" from the "details" value using ijson (Interactive Json) using code given below :
import ijson as ijson
filename='Clean_Details.json'
with open(filename,'r') as f:
objects=ijson.items(f,'details.1001.item')
for row in objects:
print(row)
print("Done")
But the Problem is that : for the loop is not terminating in the above code. After printing the final list in 1001 it keeps running.
I'm guessing that the the Generator(objects) in above code is not encountering the StopIteration don't know why.
Could Anyone help? A little help would be appreciated.