コード例 #1
0
ファイル: test_npdist.py プロジェクト: skinnersrat/dit
def test_setitem2():
    d = Distribution(['00', '11'], [1, 0])
    d.make_sparse()
    d['11'] = 1 / 2
    d.normalize()
    assert '11' in d
    assert d['11'] == pytest.approx(1 / 3)
コード例 #2
0
ファイル: test_npdist.py プロジェクト: Autoplectic/dit
def test_setitem2():
    d = Distribution(['00', '11'], [1, 0])
    d.make_sparse()
    d['11'] = 1/2
    d.normalize()
    assert '11' in d
    assert d['11'] == pytest.approx(1/3)
コード例 #3
0
ファイル: test_npdist.py プロジェクト: chebee7i/dit
def test_setitem2():
    d = Distribution(['00', '11'], [1, 0])
    d.make_sparse()
    d['11'] = 1/2
    d.normalize()
    assert_true('11' in d)
    assert_almost_equal(d['11'], 1/3)
コード例 #4
0
ファイル: test_npdist.py プロジェクト: liangkai/dit
def test_setitem2():
    d = Distribution(['00', '11'], [1, 0])
    d.make_sparse()
    d['11'] = 1 / 2
    d.normalize()
    assert_true('11' in d)
    assert_almost_equal(d['11'], 1 / 3)