dataset-examples
dataset-examples copied to clipboard
JSON_to_CSV_Converter
Hi I am trying to convert json code into CSV and I am using the code that you have provided, however I am running into some errors. When I write the $ python json_to_csv_converter.py yelp_academic_dataset.json in the commandline i am getting the following error:
Traceback (most recent call last):
File "json_to_csv_converter.py", line 122, in
Can you help me please?
@bngksgl, or anyone else, if you're seeing json DecodeErrors, it may be that the input file is not a valid json file. The Yelp dataset is delivered as a compressed archive, .tar and is, 'double-zipped'. Before running the converter script you should see 5 separate json files (business,json, review.json etc...). In Windows, after unzipping yelp_dataset_challenge_academic_dataset.tar, I had to add the .tar extension again to the ~2GB output file, and unzip that to get the individual files... Then, converting the individual json files worked fine. I ran into a similar error, not realizing the file hadn't been completely unpacked.
I faced the same issue while downloading the dataset on MAC. It is a double zipped file. Thank you @russ-white for the resolution!!
Thank you @russ-white for the explanation!
Yes, thanks from me as well
You saved a lot of time man! @russ-white