我有一个dict
,里面有17df
样本dfs
:
df1
key percent
0 step19_without_lof 14.534883720930232
df2
key percent
0 step19_without_lof 14.970930232558139
df3
key percent
0 step1_without_lof 1.5988372093023255
1 step2_without_lof 30.377906976744185
2 step5_without_lof 3.197674418604651
3 step7_without_lof 9.738372093023257
4 step12_without_lof 5.377906976744186
5 step15_without_lof 4.215116279069767
6 step16_without_lof 6.8313953488372094
7 step19_without_lof 13.80813953488372
8 step24_without_lof 9.883720930232558
9 step25_without_lof 11.337209302325581
10 step26_without_lof 9.738372093023257
11 step27_without_lof 9.738372093023257
等等
我希望合并这些dfs
,以使key
列成为每个列的名称,并填充相应的值。在df1
和df2
中,因为只有一个key
,所以剩余的keys
必须用nans
填充
您可以按如下方式执行此操作:
相关问题 更多 >
编程相关推荐