comparing two arrays

Diez B. Roggisch deets at nospam.web.de
Mon Jun 19 10:30:49 EDT 2006


Diez B. Roggisch wrote:

> print [i for i, _ in enumerate((None for v in zip(a, b) where v ==
> (1,1)))]
> 
> should give you the list of indices.

I musunderstood your question. Use


print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == y))]

instead.

Diez



More information about the Python-list mailing list