PoonLab / tragula

Mapping networks of shared research expertise by word embedding analysis
MIT License
0 stars 0 forks source link

Problem encoding text in JSON #1

Closed ArtPoon closed 6 months ago

ArtPoon commented 6 months ago
>>> records = json.load(open("data/poon_art.json"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 41 column 2 (char 2579)
ArtPoon commented 6 months ago

The problem was that I was writing JSON objects to this file line-by-line.