I am trying to learn to get information from a json file. The json file which in 250MB is size is on my desktop.
I am new to python and I am certain that I am missing something in spite of the tireless google to get an answer.
my understand while i load a Json file, the expected type is to be a Dict.
import json
with open (r'c:\eseek\limitsdata.json) as f:
data = json.load(f)
print type(data)
I get <class 'list'> as the output... but not sure why this is not a dict as I see in many tutorials
I just realized that this is similar to already available post [https://stackoverflow.com/questions/57030807/python-json-loads-returns-list-instead-of-dict]
I wanted to iterate to the json, but as i try the following steps ... it does not work
data_str = json.dumps(data)
print(data_str[0])
I dont get the first nested group, but i get the first string "["
I know I am missing something here. it will be great if someone can highlight the same
Sample data. I am trying to the task details if the model is 500 in the master file.
[
{
"Model": " 500",
"Task": “71-00-00-200-802 ",
},
{
"Model": " 900",
"Task": " 71-00-00-200-802",
}
]