diff options
author | sasha <sasha@localhost> | 2006-01-12 21:56:07 +0000 |
---|---|---|
committer | sasha <sasha@localhost> | 2006-01-12 21:56:07 +0000 |
commit | 0a407f99008973cead33d672c44006fbfa285a34 (patch) | |
tree | 15e4c70bf3e97e8b4cf27600f52e0f3f71c3bb53 /numpy | |
parent | 071f111e8c14ac2286722fb147254aebd8ff98d3 (diff) | |
download | numpy-0a407f99008973cead33d672c44006fbfa285a34.tar.gz |
made 'masked' rank-0
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/ma.py | 3 | ||||
-rw-r--r-- | numpy/core/tests/test_ma.py | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py index 7a0dc658c..eaa7a31b7 100644 --- a/numpy/core/ma.py +++ b/numpy/core/ma.py @@ -2148,5 +2148,4 @@ array.view = _m(not_implemented) del _m, MethodType, not_implemented -masked = MaskedArray([0], int, mask=[1])[0:0] -masked = masked[0:0] +masked = MaskedArray(0, int, mask=1) diff --git a/numpy/core/tests/test_ma.py b/numpy/core/tests/test_ma.py index 44cd93c9d..9577b94a4 100644 --- a/numpy/core/tests/test_ma.py +++ b/numpy/core/tests/test_ma.py @@ -626,6 +626,14 @@ class test_ma(ScipyTestCase): def check_testAPI(self): self.failIf([m for m in dir(numpy.ndarray) if m not in dir(array) and not m.startswith('_')]) + + def check_testSingleElementSubscript(self): + a = array([1,3,2]) + b = array([1,3,2], mask=[1,0,1]) + self.failUnlessEqual(a[0].shape, ()) + self.failUnlessEqual(b[0].shape, ()) + self.failUnlessEqual(b[1].shape, ()) + def timingTest(): for f in [testf, testinplace]: |