如何在python中以列表形式显示列表字典

问题描述 投票:1回答:1

我有以下字典:

Dictionary

我想打印这些词典,使它们出现在这样的易于阅读的表格中,而无需使用熊猫:

Output should look like this

到目前为止我所拥有的:

Current code

我能够打印表头,但是在映射其他列时遇到问题。

这里是要复制的字典,文字:

{'ffa':{'cope1':0.6525,'cope2':0.4146,'cope3':0.5896,'cope4':0.1521,'cope5':0.5317},'语言':{'cope1':-0.08865060000000001,'cope2':-0.150985,'cope3':-0.162005,'cope4':-0.130845,'cope5':-0.126411},'ppa':{'cope1':0.74836,'cope2':0.9444,'cope3':0.300482,'cope4':1.12435,'cope5':0.8332200000000001}}

python printing format
1个回答
0
投票

我建议为此使用pandas数据框:

© www.soinside.com 2019 - 2024. All rights reserved.