Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd39348

Browse files
authored
Merge pull request #12241 from tylerjereddy/histogramdd_test_arg_branch
TST: arg handling tests in histogramdd
2 parents 7c41164 + 9dff602 commit cd39348

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

numpy/lib/tests/test_histograms.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,3 +794,20 @@ def test_density_non_uniform_1d(self):
794794
hist_dd, edges_dd = histogramdd((v,), (bins,), density=True)
795795
assert_equal(hist, hist_dd)
796796
assert_equal(edges, edges_dd[0])
797+
798+
def test_density_via_normed(self):
799+
# normed should simply alias to density argument
800+
v = np.arange(10)
801+
bins = np.array([0, 1, 3, 6, 10])
802+
hist, edges = histogram(v, bins, density=True)
803+
hist_dd, edges_dd = histogramdd((v,), (bins,), normed=True)
804+
assert_equal(hist, hist_dd)
805+
assert_equal(edges, edges_dd[0])
806+
807+
def test_density_normed_redundancy(self):
808+
v = np.arange(10)
809+
bins = np.array([0, 1, 3, 6, 10])
810+
with assert_raises_regex(TypeError, "Cannot specify both"):
811+
hist_dd, edges_dd = histogramdd((v,), (bins,),
812+
density=True,
813+
normed=True)

0 commit comments

Comments
 (0)