diff options
author | Robert Kern <rkern@enthought.com> | 2016-05-25 14:11:27 +0100 |
---|---|---|
committer | Robert Kern <rkern@enthought.com> | 2016-05-25 14:11:27 +0100 |
commit | 3991939341a25000c16171647e4547eaa6d86055 (patch) | |
tree | 0cede493e9daf5a4e4e7bd06344c65a9daad4bcb /numpy/lib/tests/test_function_base.py | |
parent | 75705e2e8d4139985ba61c0de170c10c85027efa (diff) | |
download | numpy-3991939341a25000c16171647e4547eaa6d86055.tar.gz |
BUG: fix handling of right edge of final bin.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 868a28036..15fbbfbd7 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1418,6 +1418,11 @@ class TestHistogram(TestCase): self.assertGreaterEqual(x, left) self.assertLess(x, right) + def test_last_bin_inclusive_range(self): + arr = np.array([0., 0., 0., 1., 2., 3., 3., 4., 5.]) + hist, edges = np.histogram(arr, bins=30, range=(-0.5, 5)) + self.assertEqual(hist[-1], 1) + class TestHistogramOptimBinNums(TestCase): """ |