gpt4 book ai didi

python - 如何在 Python 中将 JSON 转换为 XLS

转载 作者:太空狗 更新时间:2023-10-29 19:32:27 25 4
gpt4 key购买 nike

有谁知道如何在 Python 中将 JSON 转换为 XLS?

我知道可以使用 Python 中的 xlwt 包创建 xls 文件。

如果我想将 JSON 数据直接转换为 XLS 文件怎么办?

有办法存档吗?

最佳答案

使用 Pandas (0.15.1) 和 openpyxl (1.8.6):

import pandas
pandas.read_json("input.json").to_excel("output.xlsx")

关于python - 如何在 Python 中将 JSON 转换为 XLS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15379178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com