[Numpy-tickets] [NumPy] #376: ma.average destroys mask

NumPy numpy-tickets at scipy.net
Fri Dec 1 23:35:20 CST 2006


#376: ma.average destroys mask
-------------------------+--------------------------------------------------
 Reporter:  roberto      |        Owner:  somebody   
     Type:  enhancement  |       Status:  reopened   
 Priority:  normal       |    Milestone:  1.0 Release
Component:  Other        |      Version:  none       
 Severity:  major        |   Resolution:             
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by oliphant):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 Notice if you have no valid values for the average, then the mask is
 preserved.

 {{{
 >>> from numpy import *
 >>> a = ma.masked_values(arange(8), 4)
 >>> a.shape = (2,2,2)
 >>> assert a.shape == a.mask.shape
 >>> a[0] = ma.masked
 >>> b = ma.average(a, axis=0)
 >>> print b.shape, b.mask.shape
 (2, 2) (2, 2)
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/376#comment:4>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list