I have a dataframe with many columns
df=
c1\
2015-01-01 [50.4750711276, 50.4750711276, 50.4750711276]
2015-01-02 [50.5349107929, 50.5349107929, 50.5349107929]
c2
2015-01-01 [33.5322374641, 33.5322374641, 33.5322374641]
2015-01-02 [33.4770757092, 33.4770757092, 33.4770757092]
I would like to split each column into columns containing the single elements of the lists. Like (for c1)
0 1 2
0 50.475071 50.475071 50.475071
1 50.534911 50.534911 50.534911
I can do
pd.DataFrame(df.c1.values.tolist()).add_prefix('code_')
but how to do it for all the columns at the same time and being able to add a prefix based on the name of the column?