summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_extras.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2015-01-13 08:07:14 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2015-01-13 08:13:51 +0100
commitb82230fdb438ba368e18ad8d3c55cb4779ab2acf (patch)
treefff72c9086dfd33c3c86c7999dd439bd54d13e4b /numpy/ma/tests/test_extras.py
parentb1f8bcf451ef75344439d56c9953f6652af899d7 (diff)
downloadnumpy-b82230fdb438ba368e18ad8d3c55cb4779ab2acf.tar.gz
BUG: fix ma.median used on ndarrays
ndarrays have a data attribute pointing to the data buffer which leads to the median working on a byte view instead of the actual type. closes gh-5424
Diffstat (limited to 'numpy/ma/tests/test_extras.py')
-rw-r--r--numpy/ma/tests/test_extras.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index d7bc765a9..8902d67dc 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -508,6 +508,10 @@ class TestMedian(TestCase):
r = np.ma.median([[np.inf, np.inf], [np.inf, np.inf]], axis=-1)
assert_equal(r, np.inf)
+ def test_non_masked(self):
+ assert_equal(np.ma.median(np.arange(9)), 4.)
+ assert_equal(np.ma.median(range(9)), 4)
+
def test_2d(self):
# Tests median w/ 2D
(n, p) = (101, 30)