【学习记录】
读取 JSON 文件的前 1000 行数据,并将这 1000 行数据储存为 HDF5 数据文件
import pandas as pd
import json
def convert(file):
fileobj = open(file)
filedata = fileobj.read()
jsondata = json.loads(filedata)[:1000]
df = pd.DataFrame(jsondata)
df.to_hdf("user_study.h5",key = "data")
convert("users_data.json")