python-解开嵌套的json
我有以下问题:我无法解开“嵌套的json”
来获取此数据集,我使用以下代码:
a = pd.json_normalize(variavel, max_level=5)
a
看最后一列“ node.phases_history”。那是嵌套的Json。无论我使用多少级别,我都无法拆开它。
因此,我试图用嵌套的JSON将列标准化。
pd.json_normalize(a['node.phases_history'])
而且,无论我设置了多少级别,它也不起作用。
而且,当我尝试它时:
pd.json_normalize(a['node.phases_history'][1])
它起作用,但仅适用于单个注册表。
有人知道我可以解决它,以及如何自动化它,无论添加了多少列?
I have the following problem: I can not unpack a "Nested JSON"
To obtain this dataset, I used the following code:
a = pd.json_normalize(variavel, max_level=5)
a
Take a look at the last column "node.phases_history". That's the nested json. No matter how many levels I use, I not being able to unpack it.
So, I tried to normalize the column with the nested JSON.
pd.json_normalize(a['node.phases_history'])
And it also does not work, again, no matter how many levels in the max_level I set.
And, when I try it:
pd.json_normalize(a['node.phases_history'][1])
It works, but only for a single registry.
Anyone knows can I solve it, and how I can automate it, no matter how much columns are added?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论