[NumPy-Tickets] [NumPy] #1421: Why does np.nan{min, max} clobber my array mask?

NumPy Trac numpy-tickets@scipy....
Fri Mar 5 09:06:25 CST 2010


#1421: Why does np.nan{min, max} clobber my array mask?
----------------------+-----------------------------------------------------
 Reporter:  bsouthey  |       Owner:  pierregm   
     Type:  defect    |      Status:  new        
 Priority:  low       |   Milestone:  Unscheduled
Component:  numpy.ma  |     Version:  devel      
 Keywords:            |  
----------------------+-----------------------------------------------------
 David Carmean provided the following to the numpy list:
 Why does np.nan{min, max} clobber my array mask?

 [http://mail.scipy.org/pipermail/numpy-
 discussion/2010-February/048628.html]

 The following code reproduces it under Linux Python2.6 with numpy version
 '2.0.0.dev8272'.
 {{{
 import numpy as np
 from numpy.ma.testutils import *
 uut = np.array([[2, 1, 3, np.nan], [5, 2, 3, np.nan]])
 msk = np.ma.masked_invalid(uut)
 oldmsk=msk.copy()
 mvalue=np.nanmin(msk, axis=1)
 assert_array_equal(msk.mask, oldmsk.mask)
 }}}

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


More information about the NumPy-Tickets mailing list