Suppose I have a set of data frames
df1 is
ID C1
0 0 0.000000
1 1 0.538516
2 2 0.509902
3 3 0.648074
4 4 0.141421
df2 is
ID C1
0 0 0.538516
1 1 0.000000
2 2 0.300000
3 3 0.331662
4 4 0.608276
and df3 is
ID C1
0 0 0.509902
1 1 0.300000
2 2 0.000000
3 3 0.244949
4 4 0.509902
I then go ahead and transpose these three data frames.
df1 = df1.T
df2 = df2.T
df3 = df3.T
Now the data frames are :
df1 is
0 1 2 3 4
ID 0 1 2 3 4
C1 0 0.538516 0.509902 0.648074 0.141421
df2 is :
0 1 2 3 4
ID 0 1 2 3 4
C1 0.538516 0 0.3 0.331662 0.608276
and df3 is :
0 1 2 3 4
ID 0 1 2 3 4
C1 0.509902 0.3 0 0.244949 0.509902
Can I somehow combine all data frames to have
0 1 2 3 4
0 0.538516 0.509902 0.648074 0.141421
0.538516 0 0.3 0.331662 0.608276
0.509902 0.3 0 0.244949 0.509902
And then sort rows individually , so that each row in the resulting data frame is sorted ?
For instance the data frame with sorted rows would be
0 0.141421 0.509902 0.538516 0.648074
0 0.3 0.331662 0.538516 0.608276
0 0.244949 0.3 0.509902 0.509902
I'm having problems with concat since I've transposed the data frames.
All help is appreciated