Skip to content

Instantly share code, notes, and snippets.

@zmaas
Last active July 8, 2020 23:24
Show Gist options
  • Save zmaas/01f767eff62797ffc2d64b087909b252 to your computer and use it in GitHub Desktop.
Save zmaas/01f767eff62797ffc2d64b087909b252 to your computer and use it in GitHub Desktop.
# Necessary dependencies
import json
import pandas as pd # Not installed by default, might need to be pip
# installed.
# There are a few ways to do this, and this is certainly not the most
# efficient, but it will work.
with open('json_file_path.json', 'r') as json_file_handle:
df = pd.DataFrame( # Load the array into the dataframe
json.loads( # Load the array as JSON
json_file_handle.read() # Read the whole file at once
)["items"] # Take the array of items
)
# df is the name of your dataframe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment