first check if it's a valid json file or not using JSON validator site

once the file is in valid json format you can use the below code to read it as dataframe

with open("training.json") as datafile:
    data = json.load(datafile)
dataframe = pd.DataFrame(data)

hope this helps.

Answer from Ravi.Dudi on Stack Overflow
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.read_json.html
pandas.read_json — pandas 3.0.1 documentation
Convert a JSON string to pandas object. This method reads JSON files or JSON-like data and converts them into pandas objects. It supports a variety of input formats, including line-delimited JSON, compressed files, and various data representations (table, records, index-based, etc.).
🌐
W3Schools
w3schools.com › python › pandas › pandas_json.asp
Pandas Read JSON
JSON is plain text, but has the format of an object, and is well known in the world of programming, including Pandas.
Discussions

How to read json file using python pandas? - Stack Overflow
I want to read json file using python pandas. Each line of the file is a complete object in JSON. I'm using below versions- python : 2.7.6 pandas: 1.19.1 json file- {"id":"111","p_id":"55","na... More on stackoverflow.com
🌐 stackoverflow.com
python - How to read a json data into a dataframe using pandas - Stack Overflow
To read straight from the file using read_json, you can use something like: More on stackoverflow.com
🌐 stackoverflow.com
Why Parse JSON With Python When Pandas Exists?
Pandas works well if you have JSON that is more or less a “record” — I.e. depth of 1 with a single value per field. Pandas is all about getting it into a dataframe, which is essentially a table. JSON can represent a lot more complicated objects. If you don’t have JSON that’s a “record” you’ll probably end up fighting against pandas. What’s your end objective? What are you trying to do with the JSON? More on reddit.com
🌐 r/learnpython
23
0
December 28, 2023
python - How to read a large json in pandas? - Stack Overflow
Hence, it is important to realize that this is not single json data rather it is multiple json objects in one file. To read this data into pandas data frame the following solution should work: More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-read-json-files-with-pandas
How to Read JSON Files with Pandas? - GeeksforGeeks
July 23, 2025 - JSON (JavaScript Object Notation) store data using key-value pairs. Reading JSON files using Pandas is simple and helpful when you're working with data in .json format.
🌐
Medium
medium.com › @amit25173 › what-is-pandas-read-json-and-why-use-it-8ee69f5bfc96
What is pandas.read_json() and Why Use It? | by Amit Yadav | Medium
March 6, 2025 - So, what’s the deal with read_json()? It’s a simple function from the Pandas library that allows you to load data from a JSON file, string, or even an API response directly into a DataFrame.
Find elsewhere
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 0.20 › generated › pandas.read_json.html
pandas.read_json — pandas 0.20.3 documentation
pandas.read_json(path_or_buf=None, orient=None, typ='frame', dtype=True, convert_axes=True, convert_dates=True, keep_default_dates=True, numpy=False, precise_float=False, date_unit=None, encoding=None, lines=False)[source]¶ · Convert a JSON string to pandas object ·
🌐
Reddit
reddit.com › r/learnpython › why parse json with python when pandas exists?
r/learnpython on Reddit: Why Parse JSON With Python When Pandas Exists?
December 28, 2023 -

Doing it with pure Python is interesting. It's incredibly flexible. It's time consuming. Is it silly?

I'm generally up for doing things the native way just because it's clean. But am I being silly not abstracting it away with some package? I was using a flavor of SQL I rarely touch the other day and was told "now with JSON support" and it actually wasn't terrible. SQL isn't exactly a bastion of exclusively new thinking. If we've already eliminated actual javascript for dealing with its JSON, why stop there? I am becoming a back in the good ole days when we used horses type of ass?

Top answer
1 of 5
12

Perhaps, the file you are reading contains multiple json objects rather and than a single json or array object which the methods json.load(json_file) and pd.read_json('review.json') are expecting. These methods are supposed to read files with single json object.

From the yelp dataset I have seen, your file must be containing something like:

{"review_id":"xxxxx","user_id":"xxxxx","business_id":"xxxx","stars":5,"date":"xxx-xx-xx","text":"xyxyxyxyxx","useful":0,"funny":0,"cool":0}
{"review_id":"yyyy","user_id":"yyyyy","business_id":"yyyyy","stars":3,"date":"yyyy-yy-yy","text":"ababababab","useful":0,"funny":0,"cool":0}
....    
....

and so on.

Hence, it is important to realize that this is not single json data rather it is multiple json objects in one file.

To read this data into pandas data frame the following solution should work:

import pandas as pd

with open('review.json') as json_file:      
    data = json_file.readlines()
    # this line below may take at least 8-10 minutes of processing for 4-5 million rows. It converts all strings in list to actual json objects. 
    data = list(map(json.loads, data)) 

pd.DataFrame(data)

Assuming the size of data to be pretty large, I think your machine will take considerable amount of time to load the data into data frame.

2 of 5
12

If you don't want to use a for-loop, the following should do the trick:

import pandas as pd

df = pd.read_json("foo.json", lines=True)

This will handle the case where your json file looks similar to this:

{"foo": "bar"}
{"foo": "baz"}
{"foo": "qux"}

And will turn it into a DataFrame consisting of a single column, foo, with three rows.

You can read more at Panda's docs

🌐
NVIDIA Developer
developer.nvidia.com › blog › json-lines-reading-with-pandas-100x-faster-using-nvidia-cudf
JSON Lines Reading with pandas 100x Faster Using NVIDIA cuDF | NVIDIA Technical Blog
April 23, 2025 - The GPU-based cudf.pandas and pylibcudf showed the highest data processing throughput for complex list and struct schema, especially for input data sizes >50 MB. cuDF supports several JSON reader options, including normalizing single quotes, recovering from invalid records, and coercing mixed types to a consistent data type, providing compatibility with Apache Spark conventions.
🌐
Snowflake Documentation
docs.snowflake.com › en › developer-guide › snowpark › reference › python › latest › modin › pandas_api › modin.pandas.read_json
modin.pandas.read_json | Snowflake Documentation
Read json files from a local folder. ... >>> with open(f'{temp_dir_name}/snowpark_pandas2.json', 'w') as f: ... json.dump(data, f) >>> df3 = pd.read_json(f'{temp_dir_name}') >>> df3 A B C 0 snowpark! 3 [5, 6] 1 snowpark!
🌐
Scaler
scaler.com › home › topics › pandas › how to load and manipulate json files with pandas
How to Load and Manipulate JSON Files with Pandas - Scaler Topics
May 4, 2023 - The read_json() is a function in the Pandas library that helps us read JSON data or JSON data files. We can pass the path of the JSON file or we can pass a Python dictionary (as it is similar to JSON) to read it.
🌐
Hevo
hevodata.com › home › learn › data strategy
Pandas Load JSON: A Comprehensive Guide
January 9, 2026 - Step 3: Load the JSON file in Pandas using the command below. import pandas as pd # you have to showcase the path to the file in your local drive. data = pd.read_json (‘pathfile_name.json') # print the loaded JSON into dataframe print(data)
🌐
YouTube
youtube.com › christopher pulliam, phd
Pandas Read JSON | Tutorial - YouTube
This video shows a short tutorial on how to use the read JSON method works for access open LA City data on SOX, NOX, and DPM
Published   January 31, 2024
Views   101
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas read json file with examples
Pandas Read JSON File with Examples - Spark By {Examples}
January 10, 2025 - Pandas read_json() function can be used to read JSON file or string into DataFrame. It supports JSON in several formats by using orient param. JSON is