[NumPy-Tickets] [NumPy] #2025: NA causes problems for the real/imag views.

NumPy Trac numpy-tickets@scipy....
Fri Jan 20 19:20:52 CST 2012


#2025: NA causes problems for the real/imag views.
---------------------+------------------------------------------------------
 Reporter:  charris  |       Owner:  somebody
     Type:  defect   |      Status:  new     
 Priority:  normal   |   Milestone:  1.7.0   
Component:  Other    |     Version:  devel   
 Keywords:           |  
---------------------+------------------------------------------------------
 {{{
 In [5]: a = np.array([np.NA], maskna=1)

 In [6]: a.real
 Out[6]: array([ NA], dtype=float64)

 In [7]: a.imag
 Out[7]: array([ 0.])
 }}}

 Imaginary part should show NA.

 {{{
 In [8]: a = np.array([np.NA], dtype=np.complex128, maskna=1)

 In [9]: a.real
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 /home/charris/<ipython-input-9-f93368bb6a37> in <module>()
 ----> 1 a.real

 ValueError: Cannot construct a view of data together with the
 NPY_ARRAY_MASKNA flag, the NA mask must be added later

 In [10]: a.imag
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 /home/charris/<ipython-input-10-e8e5f986ad96> in <module>()
 ----> 1 a.imag

 ValueError: Cannot construct a view of data together with the
 NPY_ARRAY_MASKNA flag, the NA mask must be added later

 }}}

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


More information about the NumPy-Tickets mailing list