Skip to content

JSONDecodeError: Extra data. #116

@minda-belete

Description

@minda-belete

https://csvjson.com/json_validator

I am trying to convert json file to csv but it giving me an error. I tried to read the json file in Python to change into a dataframe but it is throwing an error. Can someone help me, please?

with gzip.open('/content/drive/My Drive/JSTOR/data.gz', 'rt', encoding='UTF-8') as zipfile:
my_object = json.load(zipfile)
print(my_object)

The error I am getting is as follows

/usr/lib/python3.7/json/decoder.py in decode(self, s, _w)
338 end = _w(s, end).end()
339 if end != len(s):
--> 340 raise JSONDecodeError("Extra data", s, end)
341 return obj
342

JSONDecodeError: Extra data: line 2 column 1 (char 173565)

my json file is compressed in gzip

js.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions