コード例 #1
0
ファイル: test_npdist.py プロジェクト: skinnersrat/dit
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
コード例 #2
0
ファイル: test_npdist.py プロジェクト: chebee7i/dit
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)
コード例 #3
0
ファイル: test_npdist.py プロジェクト: skinnersrat/dit
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
コード例 #4
0
ファイル: test_npdist.py プロジェクト: chebee7i/dit
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)