import pandas as pd
import json
# 从 JSON 文件中加载数据
with open('data.json', 'r',encoding = "utf-8") as f: # 替换为你的 JSON 文件路径
data = json.load(f)
# 将 JSON 数据转换为 DataFrame
df = pd.DataFrame(data)
# 将 DataFrame 保存为 Excel 文件
df.to_excel('data.xlsx', index=False) # 保存为 Excel 文件,不包含索引列
python JSON转Excel
于 2024-05-14 14:14:54 首次发布