[Numpy-discussion] short circuit != ?

Alan G Isaac alan.isaac@gmail....
Wed Oct 27 09:05:42 CDT 2010


On 10/27/2010 9:56 AM, Zachary Pincus wrote:
> the structure of the python language prevents
> meaningful short-circuiting in the case of
> np.any(a!=b)


Maybe:
any((ai != bi) for ai,bi in izip(a.flat,b.flat))
?

fwiw,
Alan Isaac


More information about the NumPy-Discussion mailing list