[NumPy-Tickets] [NumPy] #2218: numpy.any ignores imaginary part of arrays

NumPy Trac numpy-tickets@scipy....
Tue Sep 25 08:39:30 CDT 2012


#2218: numpy.any ignores imaginary part of arrays
-------------------------+--------------------------------------------------
 Reporter:  mike.wimmer  |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  high         |   Milestone:  Unscheduled
Component:  numpy.core   |     Version:  1.6.1      
 Keywords:               |  
-------------------------+--------------------------------------------------
 In numpy versions 1.6.1, 1.6.2 and the latest git version (those I tried),
 numpy.any ignores the imaginary part of arrays completely:


 {{{
 >>> numpy.version.version
 '1.8.0.dev-6a847ef'
 >>> numpy.any([1j])
 False
 >>> numpy.any(numpy.array([1j]))
 False
 >>> numpy.any(numpy.array([0.1j]))
 False
 }}}


 whereas


 {{{
 >>> numpy.any(numpy.array([1+1j]))
 True
 >>> numpy.any(numpy.array([1+0j]))
 True
 }}}


 Now, since


 {{{
 >>> bool(1j)
 True
 }}}


 I think this is a genuine bug.

 Note that in numpy 1.5.1 all of the above returned True, i.e. the
 imaginary part was taken into account then.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2218>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list