Apr-18-2019, 12:54 PM
(Apr-18-2019, 12:19 PM)DeaD_EyE Wrote: Use itertools.product, to avoid nested loops:
[x for x,y in itertools.product(a,b) if np.array_equal(x,y)]
This is very good point.
To get answer OP looking for:
>>> sum(1 for x, y in product(a, b) if np.array_equal(x, y)) 5
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.