[Numpy-discussion] comparing arrays with NaN in them.

mark markbak@gmail....
Fri Aug 24 10:06:35 CDT 2007


There may be multiple nan-s, but what Chris did is simply create one
with the same nan's

>>> a = N.array((1,2,3,N.nan))
>>> b = N.array((1,2,3,N.nan))

I think these should be the same.
Can anybody give me a good reason why they shouldn't, because it could
confuse a lot of people?

Thanks, Mark

ps. I have to admit though, that matlab does the same thing. nan==nan
is false.

On Aug 24, 4:51 am, Warren Focke <fo...@slac.stanford.edu> wrote:
> On Thu, 23 Aug 2007, Christopher Barker wrote:
> > but that feels like a kludge. maybe some sort of "TheseArrays are binary
> > equal" would be useful.
>
> But there are multiple possible NaNs, so you couldn't rely on the bits
> comparing.
>
> Maybe something with masked arrays?
>
> w
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discuss...@scipy.orghttp://projects.scipy.org/mailman/listinfo/numpy-discussion



More information about the Numpy-discussion mailing list