I simply want to extract the indices in two list where they equal some string.
Say:
a = ['foo' for _ in range(5)]
a.extend(['bar' for _ in range(5)])
print(a)
['foo', 'foo', 'foo', 'foo', 'foo', 'bar', 'bar', 'bar', 'bar', 'bar']
b = ['foo' for _ in range(3)]
b.extend(['bar' for _ in range(7)])
print(b)
['foo', 'foo', 'foo', 'bar', 'bar', 'bar', 'bar', 'bar', 'bar', 'bar']
Then I simply want all indices with 'foo' in list a and 'bar' in list b, which should be [3, 4]
index = (a == 'foo') & (b == 'bar')
does not work as it does with e.g numpy arrays. How do I make this work? thanks a lot!!