【发布时间】:2017-03-06 07:56:06
【问题描述】:
如何使用 python 或使用直接查询将嵌套 json 从 postgresql 表转换为数据框?
json 对象的样子
[
{
"personName": "Aly Michalka",
"characterName": "Aly Michalka",
"creditType": "Actor"
},
{
"personName": "Malcolm McDowell",
"characterName": "Malcolm McDowell",
"creditType": "Actor"
},
{
"personName": "Lisa Kudrow",
"characterName": "Lisa Kudrow",
"creditType": "Actor"
},
{
"personName": "Cam Gigandet",
"characterName": "Cam Gigandet",
"creditType": "Actor"
},
{
"personName": "Patricia Clarkson",
"characterName": "Patricia Clarkson",
"creditType": "Actor"
},
{
"personName": "Thomas Haden Church",
"characterName": "Thomas Haden Church",
"creditType": "Actor"
},
{
"personName": "Amanda Bynes",
"characterName": "Amanda Bynes",
"creditType": "Actor"
},
{
"personName": "Penn Badgley",
"characterName": "Penn Badgley",
"creditType": "Actor"
},
{
"personName": "Emma Stone",
"characterName": "Emma Stone",
"creditType": "Actor"
},
{
"personName": "Will Gluck",
"characterName": "Will Gluck",
"creditType": "Director"
}
]
整个 json 对象应该对应于数据框的特定列。
【问题讨论】:
标签: postgresql python-2.7