예제 #1
0
def test_table_convert_to_bin_2():
    data = Table(
        os.path.join(os.path.dirname(__file__), 'data', 'msleep_ggplot.csv'))
    assert data.convert_to_bin('bodywt') == [(0, 738), (739, 1477),
                                             (1478, 2216), (2217, 2955),
                                             (2956, 3694), (3695, 4433),
                                             (4434, 5172), (5173, 5911),
                                             (5912, 6650), (6651, 7389)]
예제 #2
0
def test_table_convert_to_bin_1():
    data = Table(
        os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    assert data.convert_to_bin('population') == [(270, 1397), (1398, 2525),
                                                 (2526, 3653), (3654, 4781),
                                                 (4782, 5909), (5910, 7037),
                                                 (7038, 8165), (8166, 9293),
                                                 (9294, 10421), (10422, 11549),
                                                 (11550, 12677)]