コード例 #1
0
def test_percentage_missing():
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'vgsales.csv'))
    check = Check()
    assert check.percentage_missing(df) == {
        'Rank': 0.0,
        'Name': 0.0,
        'Platform': 0.0,
        'Year': 1.63,
        'Genre': 0.0,
        'Publisher': 0.35,
        'NA_Sales': 0.0,
        'EU_Sales': 0.0,
        'JP_Sales': 0.0,
        'Other_Sales': 0.0,
        'Global_Sales': 0.0
    }
コード例 #2
0
def test_percentage_missing_2():
    df = pd.read_csv(os.path.join(os.path.dirname(__file__), 'data', 'msleep_ggplot.csv'))
    check=Check()
    assert check.percentage_missing(df) == {'name': 0.0, 'genus': 0.0, 'vore': 8.43, 'order': 0.0, 'conservation': 34.94, 'sleep_total': 0.0, 'sleep_rem': 26.51, 'sleep_cycle': 61.45, 'awake': 0.0, 'brainwt': 32.53, 'bodywt': 0.0}
コード例 #3
0
def test_percentage_missing_1():
    df = pd.read_csv(os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    check=Check()
    assert check.percentage_missing(df) == {'Location': 0.0, 'population': 9.09, 'nonwhite': 0.0, 'density': 9.09, 'crime': 0.0}