Back to Pandas Notes
Topic #7

Pandas Read JSON


Read JSON

Big data sets are often stored, or extracted as JSON.

JSON is plain text, but has the format of an object, and is well known in the world of programming, including Pandas.

In our examples we will be using a JSON file called 'data.json'.

Open data.json.

Example

import pandas as pd

df = pd.read_json('data.json')

print(df.to_string())

Tip: use to_string() to print the entire DataFrame.


Dictionary as JSON

Note: JSON = Python Dictionary JSON objects have the same format as Python dictionaries.

If your JSON code is not in a file, but in a Python Dictionary, you can load it into a DataFrame directly:

Example

import pandas as pd

data = {
  "Duration":{

"0":60,
    "1":60,
    "2":60,

"3":45,
    "4":45,
    "5":60

},
  "Pulse":{
    "0":110,

"1":117,
    "2":103,
    "3":109,

"4":117,
    "5":102
  },
  "Maxpulse":{

"0":130,
    "1":145,
    "2":135,

"3":175,
    "4":148,
    "5":127

},
  "Calories":{
    "0":409,

"1":479,
    "2":340,
    "3":282,

"4":406,
    "5":300
  }
}

df = pd.DataFrame(data)

print(df)

Want to go beyond the notes?

Join Coding Now Tech Institute's Pandas course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Pandas Read JSON – FAQs

Quick answers about learning Pandas Read JSON in Pandas.

This free note from Coding Now Tech Institute explains Pandas Read JSON in Pandas — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Pandas topic on Coding Now Tech Institute, including Pandas Read JSON, is 100% free with no signup required.
With focused practice, most students grasp Pandas Read JSON in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now