I have been struggling to find the pandas solution to this without looping:
input:
df = pd.DataFrame({'A' : [[6,1,1,1], [1,5,1,1], [1,1,11,1], [1,1,1,20]]})
A
0 [6, 1, 1, 1]
1 [1, 5, 1, 1]
2 [1, 1, 11, 1]
3 [1, 1, 1, 20]
output:
A B
0 [6, 1, 1, 1] 6
1 [1, 5, 1, 1] 5
2 [1, 1, 11, 1] 11
3 [1, 1, 1, 20] 20
I have tried so many different things over the past hour or so, and I know the solution will be an embarrassingly simple one-liner. Thanks for your help -- not my python day today!