Done deaths for UK nations
[covid19.git] / covid.md
index 5b762de0275f32355e221821b654967a178b797e..318cd5d6f044f989c7d1073176c6bb869653adf6 100644 (file)
--- a/covid.md
+++ b/covid.md
@@ -233,7 +233,7 @@ ax = deaths[COUNTRIES_CORE].plot(figsize=(10, 6), title="Total deaths, linear")
 for c in COUNTRIES_CORE:
     lvi = deaths[c].last_valid_index()
     ax.text(x = lvi + 1, y = deaths[c][lvi], s = c)
-plt.savefig('covid_deaths_total_linear.png')    
+plt.savefig('covid_deaths_total_linear.png')    
 ```
 
 ```python
@@ -249,7 +249,7 @@ ax = deaths[COUNTRIES_OF_INTEREST].plot(figsize=(10, 6), title="Total deaths, li
 for c in COUNTRIES_OF_INTEREST:
     lvi = deaths[c].last_valid_index()
     ax.text(x = lvi + 1, y = deaths[c][lvi], s = c)
-plt.savefig('covid_deaths_total_linear.png') 
+plt.savefig('covid_deaths_total_linear.png') 
 ```
 
 ```python
@@ -499,6 +499,35 @@ for c in C7s:
 data_since_threshold.replace([np.inf, -np.inf], np.nan).groupby(level=1).last().loc[COUNTRIES_ALL]#, [doubling_time]]
 ```
 
+```python
+data_since_threshold.replace([np.inf, -np.inf], np.nan).groupby(level=1).last().loc[['UK', 'DE', 'IT']]#, [doubling_time]]
+```
+
+```python
+it_since_threshold = data_since_threshold.replace([np.inf, -np.inf], np.nan).loc[(slice(None), ['IT']), :]
+it_since_threshold.index.max()[0]
+```
+
+```python
+uk_projection = data_since_threshold.replace([np.inf, -np.inf], np.nan).loc[(slice(None), ['UK']), :]
+uk_projection.index.max()[0]
+```
+
+```python
+proj = it_since_threshold.loc[(slice(60, 77), slice(None)), ['cases', 'deaths']]
+proj.index = pd.MultiIndex.from_tuples([(n, 'UK') for n, _ in proj.index], names=proj.index.names)
+proj
+```
+
+```python
+uk_projection = uk_projection.append(proj, sort=True)
+uk_projection.deaths.sum()
+```
+
+```python
+it_since_threshold.deaths.sum()
+```
+
 ```python
 
 ```