Python 熊猫-带dict到数据帧的列表
我有以下输出:Python 熊猫-带dict到数据帧的列表,python,pandas,dataframe,Python,Pandas,Dataframe,我有以下输出: output = [{'test1': [('No Data', '[Auto] Clock in sync with NTP')]}, {'test2': [('No Data', '[Auto] Clock in sync with NTP'), ('No Data','Lambda - Concurrent Execution Limit') }] 所需数据帧:
output = [{'test1': [('No Data', '[Auto] Clock in sync with NTP')]},
{'test2': [('No Data', '[Auto] Clock in sync with NTP'),
('No Data','Lambda - Concurrent Execution Limit')
}]
所需数据帧:
test1 test2
0 'No Data', '[Auto] Clock in sync with NTP') 'No Data', '[Auto] Clock in sync with NTP'
1 'No Data','Lambda - Concurrent Execution Limit'
没有按我需要的那样工作。
你能帮我吗
output = [{'test1': [('No Data', '[Auto] Clock in sync with NTP')]},
{'test2': [('No Data', '[Auto] Clock in sync with NTP'),
('No Data','Lambda - Concurrent Execution Limit')]
}]
您可以这样做,但将列表作为数据帧中的单元格并不是一个好主意
pd.concat([pd.DataFrame(o) for o in output], axis=1)
您可以这样做,但将列表作为数据帧中的单元格并不是一个好主意
pd.concat([pd.DataFrame(o) for o in output], axis=1)