/usr/lib64/python2.6/site-packages/numpy/ma
NameSizeModeActions
tests/-0755rm
bench.py65670644editdlrm
bench.pyc46050644editdlrm
bench.pyo46050644editdlrm
core.py2191140644editdlrm
core.pyc2036170644editdlrm
core.pyo2036170644editdlrm
extras.py551520644editdlrm
extras.pyc530680644editdlrm
extras.pyo530680644editdlrm
mrecords.py277950644editdlrm
mrecords.pyc239190644editdlrm
mrecords.pyo239190644editdlrm
setup.py5850644editdlrm
setup.pyc9380644editdlrm
setup.pyo9380644editdlrm
setupscons.py5850644editdlrm
setupscons.pyc9480644editdlrm
setupscons.pyo9480644editdlrm
testutils.py100060644editdlrm
testutils.pyc100840644editdlrm
testutils.pyo100390644editdlrm
timer_comparison.py174590644editdlrm
timer_comparison.pyc146960644editdlrm
timer_comparison.pyo123710644editdlrm
version.py2990644editdlrm
version.pyc5280644editdlrm
version.pyo5280644editdlrm
__init__.py14940644editdlrm
__init__.pyc17280644editdlrm
__init__.pyo17280644editdlrm
Edit: /usr/lib64/python2.6/site-packages/numpy/ma/__init__.py (1494B)
""" ============= Masked Arrays ============= Arrays sometimes contain invalid or missing data. When doing operations on such arrays, we wish to suppress invalid values, which is the purpose masked arrays fulfill (an example of typical use is given below). For example, examine the following array: >>> x = np.array([2, 1, 3, np.nan, 5, 2, 3, np.nan]) When we try to calculate the mean of the data, the result is undetermined: >>> np.mean(x) nan The mean is calculated using roughly ``np.sum(x)/len(x)``, but since any number added to ``NaN`` [1]_ produces ``NaN``, this doesn't work. Enter masked arrays: >>> m = np.ma.masked_array(x, np.isnan(x)) >>> m masked_array(data = [2.0 1.0 3.0 -- 5.0 2.0 3.0 --], mask = [False False False True False False False True], fill_value=1e+20) Here, we construct a masked array that suppress all ``NaN`` values. We may now proceed to calculate the mean of the other values: >>> np.mean(m) 2.6666666666666665 .. [1] Not-a-Number, a floating point value that is the result of an invalid operation. """ __author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)" __version__ = '1.0' __revision__ = "$Revision: 3473 $" __date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' import core from core import * import extras from extras import * __all__ = ['core', 'extras'] __all__ += core.__all__ __all__ += extras.__all__ from numpy.testing import Tester test = Tester().test bench = Tester().bench