How to read JSON file from Pandas in python?

Q & ACategory: PythonHow to read JSON file from Pandas in python?
Admin Staff asked 3 years ago

How to read JSON file from Pandas in python?

1 Answers
Admin Staff answered 3 years ago

As we knows Big data sets are often extracted and stored as JSON. JSON is the plain text but have some format of object. Below is the syntax to read data from JSON file

import pandas as pdobj
df=pdobj.read_json(‘data.json’)
print(df.tostring())

In above code to_string() will print all the data in DataFrame(df)