I have list of tuples that looks like given below in a Pandas column.
0 [(1, 2)]
1 [(6, 1)]
2 [(8, 10), 4+]
3 []
4 [0.6, 1.5]
5 []
6 [2+]
7 [(0, 1)]
8 []
9 []
10 [0.7, 1+]
11 []
12 [(2, 3)]
13 [(1, 3)]
14 []
15 []
16 []
17 [2+]
18 []
19 []
I want to remove tuples and make a simple list of each row. I use the code
df['clean']=df['mix'].apply(lambda x: [ele for tup in x for ele in tup] )
the issue is that the float values are split and thats not desired. I dont understand what am I doing wrong.
0 [1, 2]
1 [6, 1]
2 [8, 10, 4, +]
3 []
4 [0, ., 6, 1, ., 5]
5 []
6 [2, +]
7 [0, 1]
8 []
9 []
10 [0, ., 7, 1, +]
11 []
12 [2, 3]
13 [1, 3]
14 []
15 []
16 []
17 [2, +]
18 []
19 []