I have a dataframe and a list
df = pd.DataFrame({'A':[1,2,3], 'B':[4,5,6]})
mylist= [10,20,30,40,50]
I would like to have a list as element in each row of a dataframe. If I do like here,
df['C'] = mylist
Pandas is trying to broadcast one value per row, so I get an error Length of values does not match length of index
.
A B C
0 1 4 [10,20,40,50]
1 2 5 [10,20,40,50]
2 3 6 [10,20,40,50]