Skip to content
Snippets Groups Projects
Commit 20cc2549 authored by Pascal's avatar Pascal
Browse files

readd

This reverts commit 2826f3ce.
parent b2f858cb
No related branches found
No related tags found
No related merge requests found
import os
import pickle as pkl
import pandas as pd
data = pd.read_csv('../data/diseases/covid19.csv', sep=',', encoding='iso-8859-1', index_col=0)
data.index = [pd.Timestamp(date) for date in data.index]
with open('../data/counties/counties.pkl', 'rb') as f:
counties = pkl.load(f)
shared_assets = '/p/project/covid19dynstat/shared_assets/'
figures = os.path.join(shared_assets, 'figures/')
dates = next(os.walk(figures))[1]
# errors if the RKI based csv is out of date with the available folders
for date in dates:
map_csv_path = os.path.join(figures, date, 'map.csv')
map_rki = data.loc[date.replace('_', '-')].values.astype('float64')
for (i, (key, _)) in enumerate(counties.items()):
n_people = counties[key]['demographics'][('total', 2018)]
map_rki[i] = map_rki[i] / n_people * 100000
map_data = pd.read_csv(map_csv_path, index_col=0)
map_data["newInf100k_RKI"] = list(map_rki)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment