예제 #1
0
def test_has_no_nans_raises():
    df = pd.DataFrame(np.random.randn(5, 3))
    df.iloc[0, 0] = np.nan
    with pytest.raises(AssertionError):
        ck.has_no_nans(df)

    with pytest.raises(AssertionError):
        dc.HasNoNans()(_add_n)(df, n=2)
예제 #2
0
def test_has_no_nans():
    df = pd.DataFrame(np.random.randn(5, 3))
    result = ck.has_no_nans(df)
    tm.assert_frame_equal(df, result)

    result = dc.HasNoNans()(_add_n)(df, 2)
    tm.assert_frame_equal(result, df + 2)
    result = dc.HasNoNans()(_add_n)(df, n=2)
    tm.assert_frame_equal(result, df + 2)