[NumPy-Tickets] [NumPy] #1709: astype should not raise ComplexWarning

NumPy Trac numpy-tickets@scipy....
Tue Jan 11 07:07:47 CST 2011


#1709: astype should not raise ComplexWarning
------------------------------------+---------------------------------------
 Reporter:  rgommers                |       Owner:  somebody
     Type:  defect                  |      Status:  new     
 Priority:  normal                  |   Milestone:  2.0.0   
Component:  numpy.core              |     Version:  devel   
 Keywords:  astype, complexwarning  |  
------------------------------------+---------------------------------------
 An explicit type cast should not raise a warning:
 {{{
 In [1]: x = np.array([1+1j, 1-1j])

 In [2]: x.astype(np.float64)
 /Library/Frameworks/Python.framework/Versions/2.6/bin/ipython:1:
 ComplexWarning: Casting complex values to real discards the imaginary part
 #!/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
 Out[2]: array([ 1.,  1.])
 }}}

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


More information about the NumPy-Tickets mailing list