Reputation: 1
Suppose I have a pandas series object where each value is a list. How do i change this series to DataFrame with columns say [a,b,c,d,e,f]
Series I have -
0 [0.7142, 0.833334, 1.0, 1.0, 1.0, 1.0]
1 [0.7142, 0.273924, 1.0, 1.0, 1.0, 1.0]
etc
expected dataframe-
id a b c d e f
0 0.71428 0.833334 1.0 1.0 1.0 1.0
1 0.71428 0.273924 1.0 1.0 1.0 1.0
Upvotes: 0
Views: 100
Reputation: 4628
IIUC:
pd.DataFrame(list(s), columns = ['a','b', 'c','d','e','f'])
Upvotes: 4