I want to transform this dataframe:
col1 col2
0 [1, 0] [0, 1]
1 [1, 1] [1, 1]
2 [0, 1] [1, 0]
3 [0, 1] [1, 1]
4 [1, 1] [0, 1]
5 [1, 0] [1, 0]
Into this one:
col1 col2
0 [1, 0] [0, 1]
1 1 1
2 [0, 1] [1, 0]
3 [0, 1] 1
4 1 [0, 1]
5 [1, 0] [1, 0]
I tried to use replace:
df.replace([1,1], 1)
But it didn't work.
dfof lists instead, and why you want to get columns with mixed types (list and ints) in the end?