Title: Load A JSON File Into Pandas
Slug: load_json_file_into_pandas
Summary: How to quickly load a JSON file into pandas.
Date: 2016-08-31 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
In [1]:
# Load library
import pandas as pd
In [2]:
# Create URL to JSON file (alternatively this can be a filepath)
url = 'https://raw.githubusercontent.com/chrisalbon/simulated_datasets/master/data.json'
# Load the first sheet of the JSON file into a data frame
df = pd.read_json(url, orient='columns')
# View the first ten rows
df.head(10)
Out[2]: