我一直在用大型json文件(1.4gb)挣扎数小时。
我的代码如下。
import json
json_data = open('data.json')
d = json.load(json_data)
我一直收到错误。我错过了这里太明显的东西吗?
Traceback (most recent call last):
File "<ipython-input-20-68c726931a15>", line 1, in <module>
d=json.load(json_data)
File "C:\Users\dvargas\Anaconda3\lib\json\__init__.py", line 265, in load
return loads(fp.read(),
File "C:\Users\dvargas\Anaconda3\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 58902: character maps to <undefined>