The Startup
Published in

The Startup

Converting nested JSON structures to Pandas DataFrames

The Problem

APIs and document databases sometimes return nested JSON objects and you’re trying to promote some of those nested keys into column headers but loading the data into pandas gives you something like this:

df = pd.DataFrame.from_records(results["issues"], columns=["key", "fields"])

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Derek Mortensen

Derek Mortensen

I write about programming, statistics and tech. Studied electrical engineering (B.Sc., M.Sc.) and I work in software.