Skip to content

Commit 429ffb3

Browse files
mknaranjapatricklnzannawendler
authored
231 establish table of active NPIs according to Corona Datenplattform and reported infection data (#443)
Establish table of active NPIs according to Corona Datenplattform and reported infection data. Co-authored-by: patricklnz <[email protected]> Co-authored-by: Anna Wendler <[email protected]>
1 parent 124313a commit 429ffb3

12 files changed

+1872
-12
lines changed

pycode/memilio-epidata/memilio/epidata/defaultDict.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
'read_data': False,
4343
'make_plot': False,
4444
'out_folder': default_file_path,
45-
'start_date': date(2020, 4, 24),
45+
'update_data': False,
46+
'start_date': date(2020, 1, 1),
4647
'end_date': date.today(),
4748
'split_berlin': False,
4849
'impute_dates': False,
@@ -103,7 +104,9 @@
103104
'nuts3': 'NUTS3',
104105
'total_volume': 'Unique_trips',
105106
'region_name': 'County',
106-
'region_id': 'ID_County'
107+
'region_id': 'ID_County',
108+
'desc': 'Description',
109+
'incidence': 'Incidence'
107110
}
108111

109112
GerEng = {

pycode/memilio-epidata/memilio/epidata/getDIVIData.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_divi_data(read_data=dd.defaultDict['read_data'],
5050
file_format=dd.defaultDict['file_format'],
5151
out_folder=dd.defaultDict['out_folder'],
5252
no_raw=dd.defaultDict['no_raw'],
53-
start_date=dd.defaultDict['start_date'],
53+
start_date=date(2020, 4, 24),
5454
end_date=dd.defaultDict['end_date'],
5555
impute_dates=dd.defaultDict['impute_dates'],
5656
moving_average=dd.defaultDict['moving_average'],

pycode/memilio-epidata/memilio/epidata/getDataIntoPandasDataFrame.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,10 @@ def write_dataframe(df, directory, file_prefix, file_type, param_dict={}):
412412
- json
413413
- json_timeasstring [Default]
414414
- hdf5
415+
- csv
415416
- txt
416417
The file_type defines the file format and thus also the file ending.
417-
The file format can be json, hdf5 or txt.
418+
The file format can be json, hdf5, csv or txt.
418419
For this option the column Date is converted from datetime to string.
419420
420421
@param df pandas dataframe (pandas DataFrame)
@@ -428,6 +429,7 @@ def write_dataframe(df, directory, file_prefix, file_type, param_dict={}):
428429
outForm = {'json': [".json", {"orient": "records"}],
429430
'json_timeasstring': [".json", {"orient": "records"}],
430431
'hdf5': [".h5", {"key": "data"}],
432+
'csv': [".csv", {}],
431433
'txt': [".txt", param_dict]}
432434

433435
try:
@@ -436,7 +438,7 @@ def write_dataframe(df, directory, file_prefix, file_type, param_dict={}):
436438
except KeyError:
437439
raise ValueError(
438440
"Error: The file format: " + file_type +
439-
" does not exist. Use json, json_timeasstring, hdf5 or txt.")
441+
" does not exist. Use json, json_timeasstring, hdf5, csv or txt.")
440442

441443
out_path = os.path.join(directory, file_prefix + outFormEnd)
442444

@@ -449,6 +451,8 @@ def write_dataframe(df, directory, file_prefix, file_type, param_dict={}):
449451
df.to_json(out_path, **outFormSpec)
450452
elif file_type == "hdf5":
451453
df.to_hdf(out_path, **outFormSpec)
454+
elif file_type == 'csv':
455+
df.to_csv(out_path)
452456
elif file_type == "txt":
453457
df.to_csv(out_path, **outFormSpec)
454458

0 commit comments

Comments
 (0)