You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pycode/memilio-epidata/memilio/epidata/getDataIntoPandasDataFrame.py
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -173,10 +173,7 @@ def get_file(
173
173
174
174
ifread_data:
175
175
try:
176
-
iffilepath.endswith('xlsx'):
177
-
df=pd.read_excel(filepath, **param_dict)
178
-
else:
179
-
df=pd.read_json(filepath)
176
+
df=pd.read_json(filepath)
180
177
exceptFileNotFoundError:
181
178
ifinteractiveanduser_choice(
182
179
"Warning: The file: "+filepath+
@@ -217,9 +214,12 @@ def get_file(
217
214
ifdf.empty:
218
215
raiseDataError("Error: Dataframe is empty.")
219
216
exceptAttributeError:
220
-
foriinrange(len(df)):
221
-
ifdf[i].empty:
222
-
raiseDataError("Error: Dataframe is empty.")
217
+
ifisinstance(df, list) orisinstance(df, dict):
218
+
foriindf:
219
+
ifdf[i].empty:
220
+
raiseDataError("Error: Dataframe is empty.")
221
+
else:
222
+
raiseDataError("Could not catch type of df: "+str(type(df)))
223
223
returndf
224
224
225
225
@@ -263,7 +263,7 @@ def cli(what):
263
263
cli_dict= {"divi": ['Downloads data from DIVI', 'start_date', 'end_date', 'impute_dates', 'moving_average', 'make_plot'],
264
264
"cases": ['Download case data from RKI', 'start_date', 'end_date', 'impute_dates', 'moving_average', 'make_plot', 'split_berlin', 'rep_date'],
265
265
"cases_est": ['Download case data from RKI and JHU and estimate recovered and deaths', 'start_date', 'end_date', 'impute_dates', 'moving_average', 'make_plot', 'split_berlin', 'rep_date'],
266
-
"population": ['Download population data from official sources'],
266
+
"population": ['Download population data from official sources', 'username'],
267
267
"commuter_official": ['Download commuter data from official sources', 'make_plot'],
0 commit comments