Пример #1
0
def test_rowargminmax_floats():
    import sys
    maxflt = sys.float_info.max
    DT = dt.Frame([(7.5, math.nan, 4.1), (math.nan, math.inf, None),
                   (math.inf, -math.inf, None), (maxflt, math.inf, -maxflt)])
    RES = DT[:, [rowargmax(f[:]), rowargmin(f[:])]]
    assert_equals(RES, dt.Frame([[0, 1, 0, 1], [2, 1, 1, 2]], stype=dt.int64))
Пример #2
0
def test_rowargminmax_int8():
    DT = dt.Frame([[4], [None], [1], [3]], stype=dt.int8)
    RES = DT[:, [rowargmax(f[:]), rowargmin(f[:])]]
    assert_equals(RES, dt.Frame([[0], [2]], stype=dt.int64))
Пример #3
0
def test_rowargminmax_almost_nas():
    DT = dt.Frame([[None], [None], [1], [None]], stype=dt.float64)
    RES = DT[:, [rowargmax(f[:]), rowargmin(f[:])]]
    assert_equals(RES, dt.Frame([[2], [2]], stype=dt.int64))
Пример #4
0
def test_rowargminmax_simple():
    DT = dt.Frame([[3], [-6], [17], [0], [5.4]])
    RES = DT[:, [rowargmax(f[:]), rowargmin(f[:])]]
    assert_equals(RES, dt.Frame([[2], [1]], stype=dt.int64))