fix data url and adapt to new data format, including type conversion, location name changes etc

This commit is contained in:
fordprefect
2020-12-15 12:11:59 +01:00
parent 5e9a7db2b5
commit 1f85b91236
5 changed files with 58 additions and 9 deletions

View File

@@ -19,7 +19,10 @@ def plot(data, countries, pop):
window_size = 7
tchar = moving_average(np.array(new_cases),window_size)/moving_average(np.array(total_cases),window_size)
thalf = np.log(2)/tchar
day_of_100_cases = np.argwhere(np.array(total_cases) > 99)[0][0]
try:
day_of_100_cases = np.argwhere(np.array(total_cases) > 99)[0][0]
except:
return
new_time_axis = time[int(window_size/2):-int(window_size/2)]
pp.plot(new_time_axis[50:], thalf[50:], label=f"{loc}", marker=".")