Thanks for the help in advance. I have a pandas data frame that looks like this:
index source timestamp value
1 car 1 ['98']
2 bike 2 ['98', 100']
3 car 3 ['65']
4 bike 4 ['100', '120']
5 plane 5 ['20' , '12', '30']
What I need, is to convert each value inside the 'value' Panda series..to a new column. So the output would be like this:
index source timestamp car bike1 bike2 plane1 plane2 plane3
1 car 1 98 Na Na Na Na Na
2 bike 2 Na 98 100 Na Na Na
3 car 3 65 Na Na Na Na Na
4 bike 4 Na 100 120 Na Na Na
5 plane 5 Na Na Na 20 12 30
For car, the size of the array will always be one, for bike 2 and for plane 3. And that translates to the number of new columns that I need in the new data frame. What is the best way to achieve this?
print (type(df.loc[1, 'value']))?print (type(df.loc[1, 'value']))?