def test_outcome_length(): outcomes = ['000', '011', '101', '110'] pmf = [1 / 4] * 4 d = Distribution(outcomes, pmf) d = d.marginal([0, 2]) assert d.outcome_length() == 2 assert d.outcome_length(masked=True) == 3
def test_outcome_length(): outcomes = ['000', '011', '101', '110'] pmf = [1/4]*4 d = Distribution(outcomes, pmf) d = d.marginal([0, 2]) assert_equal(d.outcome_length(), 2) assert_equal(d.outcome_length(masked=True), 3)
def test_coalesce(): outcomes = ['000', '011', '101', '110'] pmf = [1 / 4] * 4 d = Distribution(outcomes, pmf) d = d.coalesce([[0, 1], [2]]) assert d.outcome_length() == 2
def test_coalesce(): outcomes = ['000', '011', '101', '110'] pmf = [1/4]*4 d = Distribution(outcomes, pmf) d = d.coalesce([[0, 1], [2]]) assert_equal(d.outcome_length(), 2)