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

NumPy numpy-tickets at scipy.net
Wed Nov 8 05:53:58 CST 2006


#376: ma.average destroys mask
---------------------+------------------------------------------------------
 Reporter:  roberto  |       Owner:  somebody   
     Type:  defect   |      Status:  new        
 Priority:  normal   |   Milestone:  1.0 Release
Component:  Other    |     Version:  none       
 Severity:  major    |    Keywords:             
---------------------+------------------------------------------------------
 The function ma.average does not preserve the mask:

 >>> from numpy import *
 >>> a = ma.masked_values(arange(8), 4)
 >>> a.shape = (2,2,2)
 >>> assert a.shape == a.mask.shape
 >>> b = ma.average(a, axis=0)
 >>> assert b.shape == b.mask.shape
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 AssertionError
 >>> print b.shape, b.mask.shape
 (2, 2) ()

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


More information about the Numpy-tickets mailing list