小编Sti*_*ngo的帖子

将 JSON 数组嵌套到 Python Pandas DataFrame

我正在尝试扩展 pandas 数据框中的嵌套 json 数组。

\n

这就是我的 JSON:

\n
[ {\n        "id": "0001",\n        "name": "Stiven",\n        "location": [{\n                "country": "Colombia",\n                "department": "Choc\xc3\xb3",\n                "city": "Quibd\xc3\xb3"\n            }, {\n                "country": "Colombia",\n                "department": "Antioquia",\n                "city": "Medellin"\n            }, {\n                "country": "Colombia",\n                "department": "Cundinamarca",\n                "city": "Bogot\xc3\xa1"\n            }\n        ]\n    }, {\n        "id": "0002",\n        "name": "Jhon Jaime",\n        "location": [{\n                "country": "Colombia",\n                "department": "Valle del Cauca",\n                "city": "Cali"\n            }, {\n                "country": "Colombia",\n                "department": "Putumayo",\n                "city": "Mocoa"\n            }, {\n                "country": "Colombia",\n                "department": "Arauca",\n                "city": "Arauca"\n            }\n        ]\n    }, {\n        "id": "0003",\n …
Run Code Online (Sandbox Code Playgroud)

python json dictionary pandas json-normalize

5
推荐指数
1
解决办法
5798
查看次数

标签 统计

dictionary ×1

json ×1

json-normalize ×1

pandas ×1

python ×1