I have a header array with three things in it. My program goes through all the combinations of headers and sees if they are concurrent or not concurrent.
When I run the program I want it to print which two headers are concurrent and which are not concurrent. So basically when it prints, instead of it printing
sequences are concurrent
sequences are not concurrent
header a is concurrent to header b
header b is not concurrent to header c
for p in combinations(sequence,2):
print header[p,p], "are concurrent"
print header[p,p], "are not concurrent"
TypeError: list indices must be integers, not tuple.
You want to combine the two lists into one:
for (h1, s1), (h2, s2) in combinations(zip(header, sequence), 2): if s1[start:stop] == s2[start:stop]: print h1, h2, "are concurrent" else: print h1, h2, "are not concurrent"