I did something like this:
d = [('e', 0), ('f', 1), ('e', 0), ('f', 1)]
e = ['a']
d = [(n,j) for n,(i,j) in zip(e,d)]
d
[('a',0)]
I just tried replacing the equivalent tuple value with an array value without changing the related numbers. But the list goes only to the len array e, not d. What I want to get as output looks something like this:
d
[('a', 0), ('f', 1), ('e', 0), ('f', 1)]
source
share