def test_cateogories_and_quantiles(): with filetext(text) as fn: cats, quant = categories_and_quantiles(fn, (), {}) assert list(cats['name']) == ['Alice', 'Bob', 'Charlie', 'Dennis', 'Edith', 'Frank'] cats, quant = categories_and_quantiles(fn, (), {}, index='amount', chunkbytes=30) assert len(quant) == 2 assert (-600 < quant).all() and (600 > quant).all()
def test_categories_and_quantiles(): with filetext(text) as fn: cats, quant = categories_and_quantiles(fn, (), {}) assert list(cats["name"]) == ["Alice", "Bob", "Charlie", "Dennis", "Edith", "Frank"] cats, quant = categories_and_quantiles(fn, (), {}, index="amount", chunkbytes=30) assert len(quant) == 4 assert (-600 < quant[1:]).all() and (600 > quant[:-1]).all() assert quant[0] == -500 assert quant[-1] == 600
def test_categories_and_quantiles(): with filetext(text) as fn: cats, quant = categories_and_quantiles(fn, (), {}) assert list(cats['name']) == ['Alice', 'Bob', 'Charlie', 'Dennis', 'Edith', 'Frank'] cats, quant = categories_and_quantiles(fn, (), {}, index='amount', chunkbytes=30) assert len(quant) == 4 assert (-600 < quant[1:]).all() and (600 > quant[:-1]).all() assert quant[0] == -500 assert quant[-1] == 600