I have 3 very lengthy lists (of length 15,000). Lets say for example the three lists are:
A B C
0 2 3
0 4 5
0 3 3
1 2 6
1 3 5
0 2 7
1 8 8
I would like to get all those values of B and C that are where the corresponding index of A is 0. For example if A[i] == 0 then I would like to add B[i] to listB_0 and C[i] to listC_0.
I tried
listB_0 = []
listC_0 = []
for a,b,c in zip(A,B,C):
if a == 0:
listB_0.append(B)
listC_0.append(C)
But this seems to put Python through a never ending loop, even after 5 minutes, I see that the program is still running.
What I finally want is, for example the listB and listC for which listA = 0 will be
listB_0 = [2,4,3,2]
listC_0 = [3,5,3,7]
What is the correct way to achieve this?
Binstead of the elementb.listB_0.append(b)andlistC_0.append(c)