JSON load doesn't work for me whenever I run my code,
The code
import json
filename = 'eq_1_day_m1.json'
with open(filename) as f:
all_eq_data = json.load(f)
readable_file = 'readable_eq_data.json'
with open(readable_file, 'w') as c:
json.dump(all_eq_data, c, indent=4
It gives me this:
C:UsersPCAppDataLocalMicrosoftWindowsAppspython.exe "C:/Users/PC/PycharmProjects/Learning/Learning Matplotlib/eq_explore_data.py"
Traceback (most recent call last):
File "C:UsersPCPycharmProjectsLearningLearning Matplotlibeq_explore_data.py", line 5, in
all_eq_data = json.load(f)
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0libjson\__init__.py", line 293, in load
return loads(fp.read(),
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0libencodingscp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 10292: character maps to
Process finished with exit code 1
I have my json file: 'eq_1_day_m1.json' if you are wondering
Can you help me?