小编amr*_*tha的帖子

将dict的dict转换为pandas中的dataframe

dict喜欢这样的:

data = {'1':{'a':10, 'b':30}, '2':{'a':20, 'b':60}}
Run Code Online (Sandbox Code Playgroud)

我想转换成这样的数据帧:

x   y   z
1   a   10
1   b   30
2   a   20
2   b   60
Run Code Online (Sandbox Code Playgroud)

有人知道吗?

python dictionary dataframe python-3.x pandas

8
推荐指数
2
解决办法
2424
查看次数

标签 统计

dataframe ×1

dictionary ×1

pandas ×1

python ×1

python-3.x ×1