diff --git a/notebooks/Dashboard.ipynb b/notebooks/Dashboard.ipynb index e586a932ce5907c01f38441bed4709e23d08c704..fc0713e1271a066f77bbc743b48935bdc4d7a1a9 100644 --- a/notebooks/Dashboard.ipynb +++ b/notebooks/Dashboard.ipynb @@ -74,8 +74,8 @@ "nthresh = 500\n", "\n", "# Identify countries with {nthresh} or more cases\n", - "country_df = jhu_df.groupby('country')\n", - "countries_over_thresh = country_df.max()[country_df.max()['positive']>nthresh]['region_label']\n", + "country_max_ser = jhu_df.set_index(['region_label', 'date'])['positive'].groupby(level='region_label').max()\n", + "countries_over_thresh = country_max_ser[country_max_ser>nthresh].index\n", "\n", "# Filter out some countries with very high case/population ratio\n", "countries_over_thresh = [c for c in countries_over_thresh if c not in set(['Andorra', 'Iceland', 'San Marino'])]"