frames = [df1, df2]
result = pd.concat(frames)
result.sample(n=5)
Two datasets have 4 columns and I would like to show them in one output, 8 columns together. The way I do is just filling with NaN. I just want to combine two separate tables.
df1
Column1 Column2 Column3 Column4
151.99.51.78 56.809 54.306 2.503
99 17.727 0.000 17.727
131.253.33.203 11.136 0.211 10.925
04.79.197.203 9.298 1.013 8.285
df2
Column5 Column6 Column7 Column8
13.11.51.78 54.809 54.306 4.503
93 15.727 3.000 16.727
144.44.33.203 16.136 122.211 17.925
04.74.447.2443 8.298 23.013 77.285
Expected:
Column1 Column2 Column3 Column4 Column5 Column6 Column7 Column8
151.99.51.78 56.809 54.306 2.503 13.11.51.78 54.809 54.306 4.503
99 17.727 0.000 17.727 93 15.727 3.000 16.727
131.253.33.203 11.136 0.211 10.925 144.44.33.203 16.136 122.211 17.925
04.79.197.203 9.298 1.013 8.285 04.74.447.2443 8.298 23.013 77.285