diff options
| author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-18 15:35:19 -0700 |
|---|---|---|
| committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-18 15:35:19 -0700 |
| commit | 9f3ebd486c62785e209ff274894f45854f3570b7 (patch) | |
| tree | 4a4380f9e4c8cd78361e9785c95795cf771cd9a5 /numpy/lib/tests | |
| parent | 25a37a9c0a9b2cf0de0b221c53da92a8d34e92d5 (diff) | |
| download | numpy-9f3ebd486c62785e209ff274894f45854f3570b7.tar.gz | |
TST: test histogram bins dims
Diffstat (limited to 'numpy/lib/tests')
| -rw-r--r-- | numpy/lib/tests/test_histograms.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py index fa6ad989f..240d05174 100644 --- a/numpy/lib/tests/test_histograms.py +++ b/numpy/lib/tests/test_histograms.py @@ -265,6 +265,13 @@ class TestHistogram(object): hist, edges = np.histogram(arr, bins=30, range=(-0.5, 5)) assert_equal(hist[-1], 1) + def test_bin_array_dims(self): + # gracefully handle bins object > 1 dimension + vals = np.linspace(0.0, 1.0, num=100) + bins = np.array([[0, 0.5], [0.6, 1.0]]) + with assert_raises_regex(ValueError, "must be 1d"): + np.histogram(vals, bins=bins) + def test_unsigned_monotonicity_check(self): # Ensures ValueError is raised if bins not increasing monotonically # when bins contain unsigned values (see #9222) |
