Problem with concatenating two dataframes

Mahmood Naderan nt_mahmood at yahoo.com
Sat Nov 6 16:12:13 EDT 2021


>Try this instead:
>
>
>    dict[name] = pd.concat([dict[name], values])


OK. That fixed the problem, however, I see that they are concatenated vertically. How can I change that to horizontal? The printed dictionary in the end looks like


{'dummy':     Value
M1      0
M2      0
M3      0, 'K1':    Value
0     10
1      5
2     10
6      2
7      2
8      2, 'K2':    Value
3     20
4     10
5     15}



For K1, there should be three rows and two columns labeled as Value.




Regards,
Mahmood







More information about the Python-list mailing list