【发布时间】:2023-01-21 09:27:31
【问题描述】:
我有以下字典:
dict = {
"Building 1": {
"Energy consumption": {
"Datetime": ["2020-12-28","2021-01-04"],
"Value": [537,967]},
"Water consumption": {
"Datetime": ["2020-12-28","2021-01-04"],
"Value": [537,967]}},
"Building 2": {
"Energy consumption": {
"Datetime": ["2020-12-28","2021-01-04"],
"Value": [600,700]},
"Water consumption": {
"Datetime": ["2020-12-28","2021-01-04"],
"Value": [800,500]}}
}
我想将字典转换为熊猫数据框。我认为最好的方法是得到类似的东西:
尝试了几种方法都没有成功,有人知道如何解决这个问题吗?
【问题讨论】:
标签: python pandas dictionary