I'm having the pandas DataFrame 'test_df':
email my_list
[email protected] [1,9,3,5]
[email protected] [6,3,3,15]
[email protected] [7,7,2,5]
[email protected] [5,5,5,5]
How can I have this following DataFrame (take the first 2 elem of 'my_list'):
email col1 col2
[email protected] 1 9
[email protected] 6 3
[email protected] 7 7
[email protected] 5 5
I tried:
test_df['col1'] = test_df['my_list'][0]
test_df['col2'] = test_df['my_list'][1]
But it's not working