[Numpy-discussion] average()...?

Magnus Lie Hetland magnus at hetland.org
Sun Dec 29 13:37:02 EST 2002

Just a quick question (which I believe I have asked before sometime,
but I don't recall the outcome ;) -- why is the average() function
from MaskedArray not available in numarray? It seems like a very
useful function?

It seems that looking through the list of functions in MaskedArray
might be useful in finding candidates for numarray, in so far as they
differ. (Wouldn't be logical if they supported the same functions,
more or less?) For example, MaskedArray has the function count(),
which counts the number of elements in an array -- exactly what was
asked for yesterday, IIRC. (The use may be more obvious for masked
arrays, where it counts non-masked elements, but it works on plain
arrays too.)

If nothing else, perhaps it would be possible to put

from MA import count, average

in numarray.py? (And similarly for other functions that may be missing
in numarray -- I didn't check that closely.) Of course this wouldn't
work if MA isn't available... :/

Magnus Lie Hetland

More information about the NumPy-Discussion mailing list