Exemple #1
0
def export():
    # locations.csv
    df_loc = inject_population(load_locations().reset_index())
    df_loc['population_year'] = df_loc['population_year'].round().astype(
        'Int64')
    df_loc['population'] = df_loc['population'].round().astype('Int64')
    df_loc.to_csv(os.path.join(OUTPUT_PATH, 'locations.csv'), index=False)
    # The rest of the CSVs
    return standard_export(load_standardized(), OUTPUT_PATH)
Exemple #2
0
def export(filename):
    # locations.csv
    df_loc = inject_population(load_locations())
    df_loc['population_year'] = df_loc['population_year'].round().astype(
        'Int64')
    df_loc['population'] = df_loc['population'].round().astype('Int64')
    df_loc.to_csv(os.path.join(OUTPUT_PATH, 'locations.csv'), index=False)
    # The rest of the CSVs
    return standard_export(load_standardized(filename), OUTPUT_PATH,
                           "COVID-2019 - ECDC (2020)")
Exemple #3
0
def export(df_merged):
    df_loc = df_merged[["Country/Region", "location"]].drop_duplicates()
    df_loc = df_loc.merge(load_owid_continents(), on="location", how="left")
    df_loc = inject_population(df_loc)
    df_loc["population_year"] = df_loc["population_year"].round().astype(
        "Int64")
    df_loc["population"] = df_loc["population"].round().astype("Int64")
    df_loc.to_csv(os.path.join(OUTPUT_PATH, "locations.csv"), index=False)
    # The rest of the CSVs
    return standard_export(load_standardized(df_merged), OUTPUT_PATH,
                           DATASET_NAME)
Exemple #4
0
def export(filename):
    # locations.csv
    # load merged so that we exclude any past country names that exist in
    # ecdc_country_standardized but not in the current dataset
    df_loc = _load_merged(filename)[['countriesAndTerritories', 'location']] \
        .drop_duplicates()
    df_loc = df_loc.merge(load_owid_continents(), on='location', how='left')
    df_loc = inject_population(df_loc)
    df_loc['population_year'] = df_loc['population_year'].round().astype(
        'Int64')
    df_loc['population'] = df_loc['population'].round().astype('Int64')
    df_loc.to_csv(os.path.join(OUTPUT_PATH, 'locations.csv'), index=False)
    # The rest of the CSVs
    return standard_export(load_standardized(filename), OUTPUT_PATH,
                           DATASET_NAME)