1# Basic syntax:
2dataframe = pd.DataFrame.from_dict(json_data, orient="index")
3
4# Example usage:
5import json
6import pandas as pd
7
8# Make json-formatted string:
9json_string = '{ "name":"John", "age":30, "car":"None" }'
10your_json = json.loads(json_string)
11print(your_json)
12--> {'name': 'John', 'age': 30, 'car': 'None'}
13
14# Convert to pandas dataframe:
15dataframe = pd.DataFrame.from_dict(your_json, orient="index")
16print(dataframe)
17 0
18name John
19age 30
20car None
21
22# Note, orient="index" sets the keys as rownames. orient="columns" is
23# the default and is supposed to set the keys as column names, but I
24# couldn't seem to get it to work with this example