[Numpy-discussion] Clarifications in numpy.ma module

Alexander Belopolsky ndarray at mac.com
Tue Dec 30 14:39:12 EST 2014


On Tue, Dec 30, 2014 at 1:45 PM, Benjamin Root <ben.root at ou.edu> wrote:

> What do you mean that the mean function doesn't take care of the case
> where the array is empty? In the example you provided, they both end up
> being NaN, which is exactly correct.


Operations on masked arrays should not produce NaNs.  They should produce
ma.masked.  For example,

>>> np.ma.array(0)/0
masked

The fact that the user sees runtime warnings also suggests that the edge
case was not thought out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141230/a751342a/attachment.html>


More information about the NumPy-Discussion mailing list