May-19-2019, 06:43 PM
(May-19-2019, 02:03 PM)ichabod801 Wrote: What have you tried?
I have tried something like below but I am stuck at how to return the corresponding value
X = [2,2,2,2,2,3,4,5,6,6,6,6,6,7,8]
Y = [4,4,4,4,4,0,0,0,5,5,5,5,5,0,0]
count_sequence = [sum(1 for _ in group) for _, group in groupby(X)] print(count_sequence) for i in count_sequence: if i>= 5: print(Y[i]) #not sure if this is correct