Guys,
For some reasons, I have to put a np.array into a single column of DataFrame. It looks as :
A B C
1 [1,2] 0
2 [4] 0
3 [1,2,5,6] 0
7 [2,5,6] 0
4 [8] 0
Is there any method setting the column C based on length of column B without iteracting them ? E.g. If length(col.B) == 2 or length(col.B) == 4, C = 1, else C = -1. Then I expected :
A B C
1 [1,2] 1
2 [4] -1
3 [1,2,5,6] 1
7 [2,5,6] 1
4 [8] -1
Thanks so much.