How to read a json file directly into a Pandas DataFrame in Python
• 1 minYou might came up needing to read a JSON file and get it in a DataFrame format.
This for various reasons, but most obviously the ease of manipulation.
To do so, you will need a JSON with records in it.
Here is an example
Here is the code
import pandas as pd
# we read our json file
df = pd.read_json("my_json_file.json")
Here you are! You now know how to read a json directly into a pandas DataFrame!