[NumPy-Tickets] [NumPy] #2082: Updating the shrink keyword functionality in masked_values

NumPy Trac numpy-tickets@scipy....
Thu Mar 15 14:36:34 CDT 2012


#2082: Updating the shrink keyword functionality in masked_values
---------------------------+------------------------------------------------
 Reporter:  gsever         |       Owner:  pierregm   
     Type:  enhancement    |      Status:  new        
 Priority:  normal         |   Milestone:  Unscheduled
Component:  numpy.ma       |     Version:  devel      
 Keywords:  masked_values  |  
---------------------------+------------------------------------------------
 Considering this simple case:

 {{{
 x = np.array([1, 1.1, 2, 1.1, 3])

 ma.masked_values(x, 1.5)
 masked_array(data = [ 1.   1.1  2.   1.1  3. ],
       mask = False,
       fill_value=1.5)

 ma.masked_values(x, 1.5, shrink=False)
 masked_array(data = [ 1.   1.1  2.   1.1  3. ],
       mask = False,
       fill_value=1.5)

 }}}

 Setting the 'shrink' keyword to False should create a mask with False
 filled array provided the condition is not met. The improved shrink
 keyword handling should yield the following masked array.

 {{{
 ma.masked_values(x, 1.5, shrink=False)
 masked_array(data = [1.0 1.1 2.0 1.1 3.0],
              mask = [False False False False False],
        fill_value = 1.5)
 }}}

 The documentation about masked_values is at:
 http://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.masked_values.html

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


More information about the NumPy-Tickets mailing list