我有一个以下结构的字典,我需要将它转换成Pandas Dataframe以执行一些汇总操作。但是我无法将它转换成指定的输出格式。
我需要输出数据框以给定的格式呈现。
有人可以帮我将字典转换为所需的数据框格式吗?
{
"raj": [
{
"subject": "science",
"score": "35",
"create_time": "1595990288421"
},
{
"subject": "maths",
"score": "40",
"create_time": "1595980800000"
}
],
"dev": [
{
"subject": "science",
"score": "23",
"create_time": "1595990288421"
}
],
"mag":[
{
"subject": "science",
"score": "41",
"create_time": "1595990288421"
},
{
"subject": "maths",
"score": "25",
"create_time": "1595980800000"
}
]
}
我需要输出数据框以给定的格式呈现。
name subject score create_time
------------------------------------------
raj science 35 1595990288421
raj maths 40 1595980800000
dev science 23 1595990288421
mag science 35 1595990288421
mag maths 25 1595980800000
有人可以帮我将字典转换为所需的数据框格式吗?