コード例 #1
0
ファイル: test_core_compute.py プロジェクト: leolujuyi/blaze
def test_top_then_bottom_then_top_again_etc():
    s = symbol('s', 'var * {name: string, amount: int}')
    data = np.array([('Alice', 100), ('Bob', 200), ('Charlie', 300)],
                    dtype=[('name', 'S7'), ('amount', 'i4')])

    e = s.amount.sum() + 1
    assert top_then_bottom_then_top_again_etc(e, {s: data}) == 601
コード例 #2
0
def test_top_then_bottom_then_top_again_etc():
    s = symbol('s', 'var * {name: string, amount: int32}')
    data = np.array([('Alice', 100), ('Bob', 200), ('Charlie', 300)],
                    dtype=[('name', 'S7'), ('amount', 'i4')])

    e = s.amount.sum() + 1
    assert top_then_bottom_then_top_again_etc(e, {s: data}) == 601