def test_reductions(): assert compute(sum(t['amount']), data) == 100 + 200 + 50 assert compute(min(t['amount']), data) == 50 assert compute(max(t['amount']), data) == 200 assert compute(nunique(t['amount']), data) == 3 assert compute(nunique(t['name']), data) == 2 assert compute(count(t['amount']), data) == 3 assert compute(any(t['amount'] > 150), data) is True assert compute(any(t['amount'] > 250), data) is False
def test_reductions(): assert compute(mean(t['amount']), ddf) == 350 / 3 assert compute(count(t['amount']), ddf) == 3 assert compute(sum(t['amount']), ddf) == 100 + 200 + 50 assert compute(min(t['amount']), ddf) == 50 assert compute(max(t['amount']), ddf) == 200 assert compute(var(t['amount']), ddf) == df.amount.var(ddof=0) assert compute(var(t['amount'], unbiased=True), ddf) == df.amount.var() assert compute(std(t['amount']), ddf) == df.amount.std(ddof=0) assert compute(std(t['amount'], unbiased=True), ddf) == df.amount.std()
def test_reductions(): assert compute(mean(t['amount']), ddf) == 350 / 3.0 assert compute(count(t['amount']), ddf) == 3 assert compute(sum(t['amount']), ddf) == 100 + 200 + 50 assert compute(min(t['amount']), ddf) == 50 assert compute(max(t['amount']), ddf) == 200 tm.assert_almost_equal(compute(var(t['amount']), ddf), df.amount.var(ddof=0)) tm.assert_almost_equal(compute(var(t['amount'], unbiased=True), ddf), df.amount.var()) assert compute(std(t['amount']), ddf) == df.amount.std(ddof=0) assert compute(std(t['amount'], unbiased=True), ddf) == df.amount.std()
def test_reductions(): assert compute(mean(t['amount']), df) == 350./3 assert compute(count(t['amount']), df) == 3 assert compute(sum(t['amount']), df) == 100 + 200 + 50 assert compute(min(t['amount']), df) == 50 assert compute(max(t['amount']), df) == 200 assert compute(nunique(t['amount']), df) == 3 assert compute(nunique(t['name']), df) == 2 assert compute(any(t['amount'] > 150), df) == True assert compute(any(t['amount'] > 250), df) == False assert compute(var(t['amount']), df) == df.amount.var(ddof=0) assert compute(var(t['amount'], unbiased=True), df) == df.amount.var() assert compute(std(t['amount']), df) == df.amount.std(ddof=0) assert compute(std(t['amount'], unbiased=True), df) == df.amount.std()
def test_max_min_class(): t = TableSymbol('t', '{name: string, amount: int32}') assert str(max(t).dshape) == '{ name : string, amount : int32 }' assert str(min(t).dshape) == '{ name : string, amount : int32 }'
def test_max_min_class(): t = symbol('t', 'var * {name: string, amount: int32}') assert str(max(t).dshape) == '{name: string, amount: int32}' assert str(min(t).dshape) == '{name: string, amount: int32}'
def test_max_min_class(): t = TableSymbol("t", "{name: string, amount: int32}") assert str(max(t).dshape) == "{name: string, amount: int32}" assert str(min(t).dshape) == "{name: string, amount: int32}"