diff options
author | pierregm <pierregm@localhost> | 2009-08-30 18:08:08 +0000 |
---|---|---|
committer | pierregm <pierregm@localhost> | 2009-08-30 18:08:08 +0000 |
commit | bbe188eeb0b87d5ea08e2f142651d9cd1de652cd (patch) | |
tree | eb549ae9c28888a04f0df9b76d4e045c58691798 /numpy/ma/tests | |
parent | cb955806a508ec15ebb83fa358f63a9dc67f7a16 (diff) | |
download | numpy-bbe188eeb0b87d5ea08e2f142651d9cd1de652cd.tar.gz |
* Bugfix for ticket #1207
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r-- | numpy/ma/tests/test_core.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index dc37ff4b6..286090ad8 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -2787,6 +2787,14 @@ class TestMaskedArrayFunctions(TestCase): z = where(c, 1, masked) assert_equal(z, [99, 1, 1, 99, 99]) + def test_where_type(self): + "Test the type conservation with where" + x = np.arange(4, dtype=np.int32) + y = np.arange(4, dtype=np.float32) * 2.2 + test = where(x > 1.5, y, x).dtype + control = np.find_common_type([np.int32, np.float32], []) + assert_equal(test, control) + def test_choose(self): "Test choose" |