Use np.column_stack
Consider the sample data frame
df = pd.DataFrame(dict(
idpso=[[1.0290, 20000, 3.5155]] * 3,
pso=[[0.0417, 20000, 11.2148]] * 3
))
df
idpso pso
0 [1.029, 20000, 3.5155] [0.0417, 20000, 11.2148]
1 [1.029, 20000, 3.5155] [0.0417, 20000, 11.2148]
2 [1.029, 20000, 3.5155] [0.0417, 20000, 11.2148]
Simple expansion
pd.DataFrame(
np.column_stack(df.values.T.tolist())
)
0 1 2 3 4 5
0 1.029 20000.0 3.5155 0.0417 20000.0 11.2148
1 1.029 20000.0 3.5155 0.0417 20000.0 11.2148
2 1.029 20000.0 3.5155 0.0417 20000.0 11.2148
pd.concat
pd.concat({
k: pd.DataFrame(v.tolist())
for k, v in df.items()
}, axis=1)
idpso pso
0 1 2 0 1 2
0 1.029 20000 3.5155 0.0417 20000 11.2148
1 1.029 20000 3.5155 0.0417 20000 11.2148
2 1.029 20000 3.5155 0.0417 20000 11.2148