python pandas read json code example
Example 1: read json pandas
df = pd.read_json('data.json')
Example 2: pd.read_json('data.json') args
import json
import pandas as pd
with open('C:/Users/Alberto/nutrients.json', 'r') as f:
data = json.load(f)
df = pd.DataFrame(data)
Example 3: pd.read_json('data.json') args
data_df = pd.read_json('C:/Users/Alberto/nutrients.json', lines=True)
Example 4: pandas read json as dataframe
pd.read_json('Path/to/File.json')