Search code examples
pythonjsongoogle-colaboratoryjsonencoder

how to open json file using python


JSONDecodeError: Expecting ':' delimiter: line 1 column 8388729 (char 8388728)

import json
with open('tweets.json') as jfile:
  d = json.load(jfile)

i tried using this code.but it did not work. this is the sample data enter image description here


Solution

  • The error shows that your json data is not valid. There must be some syntax error in the json data. Specifically, it seems that there is a problem with the delimiter (':') at the specified line and column number.

    You can use any JSON validator to find out the issue. You can try this or this with a pretty formatter