Beispiel #1
0
def test_issue1225():
    f0 = dt.Frame(A=[1, 2, 3], B=[5, 6, 8], stypes={"B": "int8"})
    f1 = f0[::-1, :][:, [dt.float64(f.A), f.B]]
    assert frame_columns_virtual(f1) == [True, True]
    f1.materialize()
    assert f1.stypes == (stype.float64, stype.int8)
    assert f1.to_list() == [[3.0, 2.0, 1.0], [8, 6, 5]]
Beispiel #2
0
def test_issue1225():
    f0 = dt.Frame(A=[1, 2, 3], B=[5, 6, 8])
    f1 = f0[::-1, :][:, [dt.float64(f.A), f.B]]
    assert f1.internal.isview
    f1.materialize()
    assert f1.stypes == (stype.float64, stype.int8)
    assert f1.topython() == [[3.0, 2.0, 1.0], [8, 6, 5]]
Beispiel #3
0
def test_issue1225():
    f0 = dt.Frame(A=[1, 2, 3], B=[5, 6, 8])
    f1 = f0[::-1, :][:, [dt.float64(f.A), f.B]]
    assert frame_column_rowindex(f1, 0) is None
    assert frame_column_rowindex(f1, 1).type == "slice"
    f1.materialize()
    assert f1.stypes == (stype.float64, stype.int8)
    assert f1.to_list() == [[3.0, 2.0, 1.0], [8, 6, 5]]
Beispiel #4
0
def test_issue1225():
    f0 = dt.Frame(A=[1, 2, 3], B=[5, 6, 8])
    f1 = f0[::-1, :][:, [dt.float64(f.A), f.B]]
    # TODO: restore this check after #1188
    # assert f1.internal.isview
    f1.materialize()
    assert f1.stypes == (stype.float64, stype.int8)
    assert f1.to_list() == [[3.0, 2.0, 1.0], [8, 6, 5]]
 def transform(self, X: dt.Frame):
     if dtype_global() == np.float32:
         return X[:, [dt.float32(dt.log(dt.f[i])) for i in range(X.ncols)]]
     else:
         return X[:, [dt.float64(dt.log(dt.f[i])) for i in range(X.ncols)]]