Python Json String Parsing

基本範例

import json
import pandas as pd

#json的資料
json_data = '[{"name":"XT_180","path":"180","xxx":2},{"name":"XT_198","path":"198","xxx":3}]'

# json字串 → json object
json_object = json.loads(json_data)

# json object → dataframe
df_data = pd.json_normalize(json_object)

# json object → json字串
strjson= json.dumps(json_data)