[SciPy-user] "Approximately equal to" operator?

Martin Spacek scipy at mspacek.mm.st
Thu Jun 8 02:31:49 EDT 2006


Yup, that would do it. Should've thought of that, duh.

Thanks,

Martin

Vincent Favre-Nicolin wrote:
> On Thursday 08 June 2006 06:20, Martin Spacek wrote:
>> Is there a "~=" or "approximately equal to" operator that does an
>> elementwise comparison of two arrays, and given a certain tolerance,
>> returns a boolean array?
> 
>    You mean something like (to compare a and b): 
> 
> 	abs(a-b)<1e-6
> 
> 		Vincent

Robert Kern wrote:
 > Well, if you take a look at the source of allclose, the key part is this:
 >
 >   less(absolute(x-y), atol + rtol * absolute(y))
 >




More information about the SciPy-User mailing list