0

I am trying to convert yelp challenge dataset from json to csv format using pandas. My session crashed with memory error. like Not enough memory. I am using google colab high RAM. My code works for other files except yelp_academic_dataset_review.json file. Following is my code sample. Can anyone suggest me any solution? Thanks

import pandas as pd
df = pd.read_json('/content/drive/MyDrive/Data/yelp_academic_dataset_review.json', lines=True)

df.to_csv('/content/drive/MyDrive/Data/yelp_review.csv', index = None)
3
  • If the incoming file is one json object per line a solution like in the top answer here would be appropriate. Commented Jul 7, 2021 at 14:05
  • Does this answer your question? How do I read a large csv file with pandas? The solution to use chunksize should apply to JSON as well. Commented Jul 7, 2021 at 14:12
  • Sorry I didn't get that. It's one file named yelp_academic_dataset_review.json @JNevill Commented Jul 7, 2021 at 14:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.