Re: [Numpy-discussion] isnan surprise

2008-05-25 Thread Robert Kern
On Sun, May 25, 2008 at 1:17 PM, Keith Goodman <[EMAIL PROTECTED]> wrote: > On Sun, May 25, 2008 at 11:13 AM, Keith Goodman <[EMAIL PROTECTED]> wrote: x = np.array([1.0]) np.isnan(x) >> array([False], dtype=bool) # <- Expected np.isnan(x,x) >> array([ 0.]) # <- Surprise

Re: [Numpy-discussion] isnan surprise

2008-05-25 Thread Keith Goodman
On Sun, May 25, 2008 at 11:13 AM, Keith Goodman <[EMAIL PROTECTED]> wrote: >>> x = np.array([1.0]) >>> np.isnan(x) > array([False], dtype=bool) # <- Expected >>> np.isnan(x,x) > array([ 0.]) # <- Surprise (to me) I guess this is not surprising since I'm asking isnan to put the answer

[Numpy-discussion] isnan surprise

2008-05-25 Thread Keith Goodman
>> x = np.array([1.0]) >> np.isnan(x) array([False], dtype=bool) # <- Expected >> np.isnan(x,x) array([ 0.]) # <- Surprise (to me) The same happens with isfinite, isinf, etc. My use case (self.x is an array): def isnan(self): y = self.copy() np.isnan(y.x, y.x)