示例#1
0
def test_apply_column():
    result = compute(t.amount.apply(np.sum, 'real'), df)
    expected = np.sum(df['amount'])
    assert result == expected

    result = compute(t.amount.apply(builtins.sum, 'real'), df)
    expected = builtins.sum(df['amount'])
    assert result == expected
示例#2
0
def test_apply_column():
    result = compute(t.amount.apply(np.sum, 'real'), df)
    expected = np.sum(df['amount'])
    assert result == expected

    result = compute(t.amount.apply(builtins.sum, 'real'), df)
    expected = builtins.sum(df['amount'])
    assert result == expected
示例#3
0
def test_apply_column():
    result = compute(Apply(np.sum, t['amount']), df)
    expected = np.sum(df['amount'])

    assert str(result) == str(expected)

    result = compute(Apply(builtins.sum, t['amount']), df)
    expected = builtins.sum(df['amount'])

    assert str(result) == str(expected)
示例#4
0
def test_apply_column():
    result = compute(Apply(t['amount'], np.sum), df)
    expected = np.sum(df['amount'])

    assert str(result) == str(expected)

    result = compute(Apply(t['amount'], builtins.sum), df)
    expected = builtins.sum(df['amount'])

    assert str(result) == str(expected)