def test_custom_nindex_impute_1(pos1, pos2, expected, mw_data):
    mw_data[pos1, pos2] = np.nan
    imputed = impy.moving_window(mw_data, nindex=-1)
    return_na_check(imputed)
    assert imputed[pos1, pos2] == expected
def test_defaults_impute(pos1, pos2, expected, mw_data):
    mw_data[pos1, pos2] = np.nan
    imputed = impy.moving_window(mw_data)
    return_na_check(imputed)
    assert imputed[pos1, pos2] == expected
def test_custom_fn_impute(pos1, pos2, expected, mw_data):
    mw_data[pos1, pos2] = np.nan
    imputed = impy.moving_window(mw_data, func=lambda l: max(l) * 2)
    return_na_check(imputed)
    assert imputed[pos1, pos2] == expected
Beispiel #4
0
def test_random_(test_data):
    data = test_data(SHAPE)
    imputed = impy.random(data)
    return_na_check(imputed)
Beispiel #5
0
def test_em_(test_data):
    data = test_data(SHAPE)
    imputed = impy.em(data)
    return_na_check(imputed)
Beispiel #6
0
def test_locf_(test_data):
    data = test_data(SHAPE)
    imputed = impy.locf(data)
    return_na_check(imputed)
Beispiel #7
0
def test_complete_case_(test_data):
    data = test_data(SHAPE)
    imputed = complete_case(data)
    return_na_check(imputed)
def test_buck_iter(buck_test_data):
    imputed = impy.buck_iterative(buck_test_data)
    return_na_check(imputed)
Beispiel #9
0
def test_mean(test_data):
    data = test_data(SHAPE)
    imputed = impy.mean(data)
    return_na_check(imputed)
Beispiel #10
0
def test_return_type(knn_test_data):
    imputed = impy.fast_knn(knn_test_data)
    return_na_check(imputed)