对于有文件形式的
import json
with open(filename) as json_file:
data = json.load(json_file)
也可以用pandas读取,不过这需要json数据各行具有一致的维度:
import pandas as pd
with open(fielname) as json_file:
data = pd.read_json(json_file)
对于有文件形式的
import json
with open(filename) as json_file:
data = json.load(json_file)
也可以用pandas读取,不过这需要json数据各行具有一致的维度:
import pandas as pd
with open(fielname) as json_file:
data = pd.read_json(json_file)