summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2016-12-11 20:35:50 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2016-12-11 20:35:50 +0100
commitba6fdacd434a70496cfc61240e34045b6a6550a7 (patch)
tree622cf87f78678d40974420bd71ac74c49ae39ebf /numpy/lib/tests
parente00b9587052248486a9bf66c2ce95638c0d9817f (diff)
downloadnumpy-ba6fdacd434a70496cfc61240e34045b6a6550a7.tar.gz
BUG: fix nanpercentile not returning scalar with axis argument
Closes gh-8220
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_nanfunctions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py
index 06c0953b5..3fde51a73 100644
--- a/numpy/lib/tests/test_nanfunctions.py
+++ b/numpy/lib/tests/test_nanfunctions.py
@@ -805,7 +805,11 @@ class TestNanFunctions_Percentile(TestCase):
assert_(len(w) == 0)
def test_scalar(self):
- assert_(np.nanpercentile(0., 100) == 0.)
+ assert_equal(np.nanpercentile(0., 100), 0.)
+ a = np.arange(6)
+ r = np.nanpercentile(a, 50, axis=0)
+ assert_equal(r, 2.5)
+ assert_(np.isscalar(r))
def test_extended_axis_invalid(self):
d = np.ones((3, 5, 7, 11))