I have five different pandas data frames showing results of calculations done of the same data with same number of samples , all the arrays are identical in shape. (5x10)
df shape for each data set:
(recording channels)
0 1 2 3 4 5 6 7 8 9
t)
0 x x x x x x x x x x
1 x x x x x x x x x x
2 x x x x x x x x x x
3 x x x x x x x x x x
4 x x x x x x x x x x
df 1 : calculation 1
df 2 : calculation 2
.
.
.
df 5 : calculation 5
I want to merge all these data frames into a single data frame which looks something like this:
recording_channel-----time-----cal_1----cal_2----cal_3....cal_5
0 0 x x x x
0 1 x x x x
0 2 x x x x
0 3 x x x x
0 4 x x x x
1 0 x x x x
1 1 x x x x
1 2 x x x x
1 3 x x x x
1 4 x x x x
. . . . . .
. . . . . .
9 4 x x x x
code to generate data:
import numpy as np
import pandas as pd
list_df = []
for i in range(5):
a = np.array(np.random.randint(0,1000+i, 50))
a = a.reshape(5,10)
df = pd.DataFrame(a)
list_df.append(df)
for i in list_df:
print(len(i))
df_joined = pd.concat(list_df, axis=1)
print(df_joined)