示例#1
0
文件: test_io.py 项目: bjlittle/dask
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()
示例#2
0
文件: test_io.py 项目: roxyboy/dask
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
示例#3
0
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