[SciPy-user] scipy_core bug in where

Travis Oliphant oliphant at ee.byu.edu
Thu Nov 17 22:47:24 CST 2005


Ted Horst wrote:

>I have discovered a bug in the where function in scipy_core.
>
> >>> from scipy import array, int16, where
> >>> a = array([1,2,3,-32766,4,5,-32766,6], dtype = int16)
> >>> where(a != -32766, a, a.max())
>array([      65538,      229378,      262149,           6,       65538,
>             229378,           6, -2147352570])
>
>
>First, I was a little surprised that a.max() was type int32 rather than 
>int16 (which causes the result to have dtype int32), but then a is 
>clearly be misinterpreted.
>  
>
Actually a.max() should return int16.  It is an oversight and will be 
fixed.

-travis



More information about the SciPy-user mailing list