diff options
| author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-21 21:23:54 -0700 |
|---|---|---|
| committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-22 10:45:47 -0700 |
| commit | 9dff602e2e2250fa64df5f64927ee0e9652b2420 (patch) | |
| tree | 0e5e2a7dbdab50a22a60ba6e56cc869c18a48e30 /numpy/lib | |
| parent | db5750f6cdc2715f1c65be31f985e2cd2699d2e0 (diff) | |
| download | numpy-9dff602e2e2250fa64df5f64927ee0e9652b2420.tar.gz | |
TST: arg handling tests in histogramdd
Diffstat (limited to 'numpy/lib')
| -rw-r--r-- | numpy/lib/tests/test_histograms.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py index 1b5a71d0e..5b51763b2 100644 --- a/numpy/lib/tests/test_histograms.py +++ b/numpy/lib/tests/test_histograms.py @@ -794,3 +794,20 @@ class TestHistogramdd(object): hist_dd, edges_dd = histogramdd((v,), (bins,), density=True) assert_equal(hist, hist_dd) assert_equal(edges, edges_dd[0]) + + def test_density_via_normed(self): + # normed should simply alias to density argument + v = np.arange(10) + bins = np.array([0, 1, 3, 6, 10]) + hist, edges = histogram(v, bins, density=True) + hist_dd, edges_dd = histogramdd((v,), (bins,), normed=True) + assert_equal(hist, hist_dd) + assert_equal(edges, edges_dd[0]) + + def test_density_normed_redundancy(self): + v = np.arange(10) + bins = np.array([0, 1, 3, 6, 10]) + with assert_raises_regex(TypeError, "Cannot specify both"): + hist_dd, edges_dd = histogramdd((v,), (bins,), + density=True, + normed=True) |
