-1
I’m trying to convert json the data into a dictionary. This json_test to be a Dict type but actually comes as a list type when I check with type(json1_data).
import json
json1_file = open('json_teste')
json1_str = json1_file.read()
json1_data = json.loads(json_str)
A tip: if you opened the file, you don’t need to play all the content in a string to then read the JSON, you can do it at once:
json1_data = json.load(json1_file)
– hkotsubo
Thanks for the tip.
– William Chances