{ "cells": [ { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import altair as alt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Look at the metadata" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "metadata_df = pd.read_json('../../data/covidtracking/states-metadata.json')" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>state</th>\n", " <th>covid19SiteOld</th>\n", " <th>covid19Site</th>\n", " <th>covid19SiteSecondary</th>\n", " <th>twitter</th>\n", " <th>pui</th>\n", " <th>pum</th>\n", " <th>notes</th>\n", " <th>name</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>AK</td>\n", " <td>http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-...</td>\n", " <td>http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-...</td>\n", " <td>http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-...</td>\n", " <td>@Alaska_DHSS</td>\n", " <td>All data</td>\n", " <td>False</td>\n", " <td>Unclear if their reported number means \"person...</td>\n", " <td>Alaska</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>AL</td>\n", " <td>http://www.alabamapublichealth.gov/infectiousd...</td>\n", " <td>https://alpublichealth.maps.arcgis.com/apps/op...</td>\n", " <td>None</td>\n", " <td>@alpublichealth</td>\n", " <td>No data</td>\n", " <td>False</td>\n", " <td>Last negative count from 3/16. Last update tim...</td>\n", " <td>Alabama</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>AR</td>\n", " <td>https://www.healthy.arkansas.gov/programs-serv...</td>\n", " <td>https://www.healthy.arkansas.gov/programs-serv...</td>\n", " <td>None</td>\n", " <td>@adhpio</td>\n", " <td>All data</td>\n", " <td>True</td>\n", " <td>Pending = \"PUIs\"</td>\n", " <td>Arkansas</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>AS</td>\n", " <td>http://www.samoagovt.ws/2020/03/ministry-of-he...</td>\n", " <td>https://www.facebook.com/amsamgov/</td>\n", " <td>https://www.americansamoa.gov/?fbclid=IwAR2EKT...</td>\n", " <td>None</td>\n", " <td>No Data</td>\n", " <td>False</td>\n", " <td>American Samoa: No data, no confirmed cases yet.</td>\n", " <td>American Samoa</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>AZ</td>\n", " <td>https://www.azdhs.gov/preparedness/epidemiolog...</td>\n", " <td>https://www.azdhs.gov/preparedness/epidemiolog...</td>\n", " <td>None</td>\n", " <td>@azdhs</td>\n", " <td>All data</td>\n", " <td>False</td>\n", " <td>Negative = “Ruled Out”. Negatives are from pub...</td>\n", " <td>Arizona</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " state covid19SiteOld \\\n", "0 AK http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-... \n", "1 AL http://www.alabamapublichealth.gov/infectiousd... \n", "2 AR https://www.healthy.arkansas.gov/programs-serv... \n", "3 AS http://www.samoagovt.ws/2020/03/ministry-of-he... \n", "4 AZ https://www.azdhs.gov/preparedness/epidemiolog... \n", "\n", " covid19Site \\\n", "0 http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-... \n", "1 https://alpublichealth.maps.arcgis.com/apps/op... \n", "2 https://www.healthy.arkansas.gov/programs-serv... \n", "3 https://www.facebook.com/amsamgov/ \n", "4 https://www.azdhs.gov/preparedness/epidemiolog... \n", "\n", " covid19SiteSecondary twitter \\\n", "0 http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-... @Alaska_DHSS \n", "1 None @alpublichealth \n", "2 None @adhpio \n", "3 https://www.americansamoa.gov/?fbclid=IwAR2EKT... None \n", "4 None @azdhs \n", "\n", " pui pum notes \\\n", "0 All data False Unclear if their reported number means \"person... \n", "1 No data False Last negative count from 3/16. Last update tim... \n", "2 All data True Pending = \"PUIs\" \n", "3 No Data False American Samoa: No data, no confirmed cases yet. \n", "4 All data False Negative = “Ruled Out”. Negatives are from pub... \n", "\n", " name \n", "0 Alaska \n", "1 Alabama \n", "2 Arkansas \n", "3 American Samoa \n", "4 Arizona " ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "metadata_df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load most recent data and look at it" ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [], "source": [ "data_df = pd.read_json('../../data/covidtracking/states-daily.json')\n", "data_df['date'] = pd.to_datetime(data_df['date'], format=\"%Y%m%d\")" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>date</th>\n", " <th>state</th>\n", " <th>positive</th>\n", " <th>negative</th>\n", " <th>pending</th>\n", " <th>death</th>\n", " <th>total</th>\n", " <th>dateChecked</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>2020-03-20</td>\n", " <td>AK</td>\n", " <td>12</td>\n", " <td>686.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>698</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>2020-03-20</td>\n", " <td>AL</td>\n", " <td>81</td>\n", " <td>28.0</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>109</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>2020-03-20</td>\n", " <td>AR</td>\n", " <td>96</td>\n", " <td>351.0</td>\n", " <td>203.0</td>\n", " <td>NaN</td>\n", " <td>650</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>2020-03-20</td>\n", " <td>AS</td>\n", " <td>0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>0</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>2020-03-20</td>\n", " <td>AZ</td>\n", " <td>65</td>\n", " <td>211.0</td>\n", " <td>101.0</td>\n", " <td>0.0</td>\n", " <td>377</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " date state positive negative pending death total \\\n", "0 2020-03-20 AK 12 686.0 NaN NaN 698 \n", "1 2020-03-20 AL 81 28.0 NaN 0.0 109 \n", "2 2020-03-20 AR 96 351.0 203.0 NaN 650 \n", "3 2020-03-20 AS 0 NaN NaN 0.0 0 \n", "4 2020-03-20 AZ 65 211.0 101.0 0.0 377 \n", "\n", " dateChecked \n", "0 2020-03-20T20:00:00Z \n", "1 2020-03-20T20:00:00Z \n", "2 2020-03-20T20:00:00Z \n", "3 2020-03-20T20:00:00Z \n", "4 2020-03-20T20:00:00Z " ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Daily counts and totals" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [], "source": [ "# compute daily differences\n", "tdf = data_df.sort_values(['state', 'date'], ascending=[True, False]).set_index(['state', 'date'])\n", "diffs_df = tdf[['positive', 'negative', 'death']].groupby(level='state').diff(periods=-1).dropna(how='all')\n", "tdf_diff=tdf.join(diffs_df, rsuffix='_diff').reset_index()\n", "\n", "# \"Normalizing\" the totals\n", "tdf_diff['total_10'] = tdf_diff['total']/10." ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "<div id=\"altair-viz-e5533fc0f87b40628f90c34f622a4bce\"></div>\n", "<script type=\"text/javascript\">\n", " (function(spec, embedOpt){\n", " const outputDiv = document.getElementById(\"altair-viz-e5533fc0f87b40628f90c34f622a4bce\");\n", " const paths = {\n", " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n", " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", " };\n", "\n", " function loadScript(lib) {\n", " return new Promise(function(resolve, reject) {\n", " var s = document.createElement('script');\n", " s.src = paths[lib];\n", " s.async = true;\n", " s.onload = () => resolve(paths[lib]);\n", " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " });\n", " }\n", "\n", " function showError(err) {\n", " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", " throw err;\n", " }\n", "\n", " function displayChart(vegaEmbed) {\n", " vegaEmbed(outputDiv, spec, embedOpt)\n", " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", " }\n", "\n", " if(typeof define === \"function\" && define.amd) {\n", " requirejs.config({paths});\n", " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", " } else if (typeof vegaEmbed === \"function\") {\n", " displayChart(vegaEmbed);\n", " } else {\n", " loadScript(\"vega\")\n", " .then(() => loadScript(\"vega-lite\"))\n", " .then(() => loadScript(\"vega-embed\"))\n", " .catch(showError)\n", " .then(() => displayChart(vegaEmbed));\n", " }\n", " })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"hconcat\": [{\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"WA\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"WA\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"WA\", \"width\": 250}]}], \"data\": {\"name\": \"data-1180c2f4d0b6c8dd916903ca4c0d70bf\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"NY\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"NY\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"NY\", \"width\": 250}]}], \"data\": {\"name\": \"data-27d6cf9464e86d250ce7b9ad9526c806\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"MA\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"MA\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"MA\", \"width\": 250}]}], \"data\": {\"name\": \"data-dea1341c1a17e5d61b64cba9e71853ed\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"CA\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"CA\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"CA\", \"width\": 250}]}], \"data\": {\"name\": \"data-2044206653abf4cf683f7eb7b0e2e7cf\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"OK\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"OK\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"OK\", \"width\": 250}]}], \"data\": {\"name\": \"data-15c49aeabdb5b7acee8110bdf90966fc\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"LA\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"LA\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"LA\", \"width\": 250}]}], \"data\": {\"name\": \"data-2480c6153905f8996f1be25f2c4ce853\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"FL\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"FL\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"FL\", \"width\": 250}]}], \"data\": {\"name\": \"data-c4deee1167555a60ac3fe96783b25881\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"NJ\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"NJ\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"NJ\", \"width\": 250}]}], \"data\": {\"name\": \"data-66a15f0a91cacd8abf8cfa13204a7e81\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"NC\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"NC\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"NC\", \"width\": 250}]}], \"data\": {\"name\": \"data-ddffbf8d2dd76c1c297388ebe03e44ee\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}, {\"layer\": [{\"mark\": {\"type\": \"bar\", \"size\": 10}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Daily positive\"}, \"field\": \"daily_positive\"}}, \"height\": 150, \"title\": \"GA\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"lightgreen\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Tests/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"GA\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"# Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"GA\", \"width\": 250}]}], \"data\": {\"name\": \"data-3d1b17d38cf3d74b0371cfc3b471f3bc\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}], \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-1180c2f4d0b6c8dd916903ca4c0d70bf\": [{\"state\": \"WA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1376, \"negative\": 19336.0, \"pending\": null, \"death\": 74.0, \"total\": 20712, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 189.0, \"negative_diff\": 3418.0, \"death_diff\": 8.0, \"total_10\": 2071.2, \"daily_positive\": 189.0}, {\"state\": \"WA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 1187, \"negative\": 15918.0, \"pending\": null, \"death\": 66.0, \"total\": 17105, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 175.0, \"negative_diff\": 2801.0, \"death_diff\": 14.0, \"total_10\": 1710.5, \"daily_positive\": 175.0}, {\"state\": \"WA\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 1012, \"negative\": 13117.0, \"pending\": null, \"death\": 52.0, \"total\": 14129, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 108.0, \"negative_diff\": 1535.0, \"death_diff\": 4.0, \"total_10\": 1412.9, \"daily_positive\": 108.0}, {\"state\": \"WA\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 904, \"negative\": 11582.0, \"pending\": null, \"death\": 48.0, \"total\": 12486, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 135.0, \"negative_diff\": 2131.0, \"death_diff\": 6.0, \"total_10\": 1248.6, \"daily_positive\": 135.0}, {\"state\": \"WA\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 769, \"negative\": 9451.0, \"pending\": null, \"death\": 42.0, \"total\": 10220, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 127.0, \"negative_diff\": 2329.0, \"death_diff\": 2.0, \"total_10\": 1022.0, \"daily_positive\": 127.0}, {\"state\": \"WA\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 642, \"negative\": 7122.0, \"pending\": null, \"death\": 40.0, \"total\": 7764, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 74.0, \"negative_diff\": 1121.0, \"death_diff\": 3.0, \"total_10\": 776.4, \"daily_positive\": 74.0}, {\"state\": \"WA\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 568, \"negative\": 6001.0, \"pending\": null, \"death\": 37.0, \"total\": 6569, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 111.0, \"negative_diff\": 1651.0, \"death_diff\": 6.0, \"total_10\": 656.9, \"daily_positive\": 111.0}, {\"state\": \"WA\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 457, \"negative\": 4350.0, \"pending\": null, \"death\": 31.0, \"total\": 4807, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 120.0, \"negative_diff\": 1313.0, \"death_diff\": 2.0, \"total_10\": 480.7, \"daily_positive\": 120.0}, {\"state\": \"WA\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 337, \"negative\": 3037.0, \"pending\": null, \"death\": 29.0, \"total\": 3403, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 70.0, \"negative_diff\": 862.0, \"death_diff\": 5.0, \"total_10\": 340.3, \"daily_positive\": 70.0}, {\"state\": \"WA\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 267, \"negative\": 2175.0, \"pending\": null, \"death\": 24.0, \"total\": 2466, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 105.0, \"negative_diff\": 1065.0, \"death_diff\": null, \"total_10\": 246.6, \"daily_positive\": 105.0}, {\"state\": \"WA\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 162, \"negative\": 1110.0, \"pending\": null, \"death\": null, \"total\": 1272, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 26.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 127.2, \"daily_positive\": 26.0}, {\"state\": \"WA\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 136, \"negative\": 1110.0, \"pending\": null, \"death\": null, \"total\": 1246, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 34.0, \"negative_diff\": 470.0, \"death_diff\": null, \"total_10\": 124.6, \"daily_positive\": 34.0}, {\"state\": \"WA\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 102, \"negative\": 640.0, \"pending\": 60.0, \"death\": null, \"total\": 802, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 270.0, \"death_diff\": null, \"total_10\": 80.2, \"daily_positive\": 0.0}, {\"state\": \"WA\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 102, \"negative\": 370.0, \"pending\": 66.0, \"death\": null, \"total\": 538, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 23.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 53.8, \"daily_positive\": 23.0}, {\"state\": \"WA\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 79, \"negative\": 370.0, \"pending\": null, \"death\": null, \"total\": 449, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 9.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 44.9, \"daily_positive\": 9.0}, {\"state\": \"WA\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 70, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 70, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 31.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 7.0, \"daily_positive\": 31.0}, {\"state\": \"WA\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 39, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 39, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 3.9, \"daily_positive\": null}], \"data-27d6cf9464e86d250ce7b9ad9526c806\": [{\"state\": \"NY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7102, \"negative\": 25325.0, \"pending\": null, \"death\": 35.0, \"total\": 32427, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 2950.0, \"negative_diff\": 7193.0, \"death_diff\": 23.0, \"total_10\": 3242.7, \"daily_positive\": 2950.0}, {\"state\": \"NY\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 4152, \"negative\": 18132.0, \"pending\": null, \"death\": 12.0, \"total\": 22284, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 1770.0, \"negative_diff\": 5917.0, \"death_diff\": 0.0, \"total_10\": 2228.4, \"daily_positive\": 1770.0}, {\"state\": \"NY\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 2382, \"negative\": 12215.0, \"pending\": null, \"death\": 12.0, \"total\": 14597, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 682.0, \"negative_diff\": 6709.0, \"death_diff\": 5.0, \"total_10\": 1459.7, \"daily_positive\": 682.0}, {\"state\": \"NY\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 1700, \"negative\": 5506.0, \"pending\": null, \"death\": 7.0, \"total\": 7206, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 750.0, \"negative_diff\": 963.0, \"death_diff\": 0.0, \"total_10\": 720.6, \"daily_positive\": 750.0}, {\"state\": \"NY\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 950, \"negative\": 4543.0, \"pending\": null, \"death\": 7.0, \"total\": 5493, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 221.0, \"negative_diff\": 0.0, \"death_diff\": 4.0, \"total_10\": 549.3, \"daily_positive\": 221.0}, {\"state\": \"NY\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 729, \"negative\": 4543.0, \"pending\": null, \"death\": 3.0, \"total\": 5272, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 205.0, \"negative_diff\": 1764.0, \"death_diff\": null, \"total_10\": 527.2, \"daily_positive\": 205.0}, {\"state\": \"NY\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 524, \"negative\": 2779.0, \"pending\": null, \"death\": null, \"total\": 3303, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 103.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 330.3, \"daily_positive\": 103.0}, {\"state\": \"NY\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 421, \"negative\": 2779.0, \"pending\": null, \"death\": null, \"total\": 3200, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 205.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 320.0, \"daily_positive\": 205.0}, {\"state\": \"NY\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 216, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 216, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 21.6, \"daily_positive\": 0.0}, {\"state\": \"NY\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 216, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 216, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 43.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 21.6, \"daily_positive\": 43.0}, {\"state\": \"NY\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 173, \"negative\": 92.0, \"pending\": null, \"death\": null, \"total\": 265, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 31.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 26.5, \"daily_positive\": 31.0}, {\"state\": \"NY\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 142, \"negative\": 92.0, \"pending\": null, \"death\": null, \"total\": 234, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 37.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 23.4, \"daily_positive\": 37.0}, {\"state\": \"NY\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 105, \"negative\": 92.0, \"pending\": null, \"death\": null, \"total\": 197, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 29.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 19.7, \"daily_positive\": 29.0}, {\"state\": \"NY\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 76, \"negative\": 92.0, \"pending\": 236.0, \"death\": null, \"total\": 404, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 43.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 40.4, \"daily_positive\": 43.0}, {\"state\": \"NY\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 33, \"negative\": 92.0, \"pending\": 236.0, \"death\": null, \"total\": 361, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 11.0, \"negative_diff\": 16.0, \"death_diff\": null, \"total_10\": 36.1, \"daily_positive\": 11.0}, {\"state\": \"NY\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 22, \"negative\": 76.0, \"pending\": 24.0, \"death\": null, \"total\": 122, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 16.0, \"negative_diff\": 28.0, \"death_diff\": null, \"total_10\": 12.2, \"daily_positive\": 16.0}, {\"state\": \"NY\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 6, \"negative\": 48.0, \"pending\": 24.0, \"death\": null, \"total\": 78, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 7.8, \"daily_positive\": null}], \"data-dea1341c1a17e5d61b64cba9e71853ed\": [{\"state\": \"MA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 413, \"negative\": 3678.0, \"pending\": null, \"death\": 1.0, \"total\": 4091, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 85.0, \"negative_diff\": 874.0, \"death_diff\": null, \"total_10\": 409.1, \"daily_positive\": 85.0}, {\"state\": \"MA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 328, \"negative\": 2804.0, \"pending\": null, \"death\": null, \"total\": 3132, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 72.0, \"negative_diff\": 789.0, \"death_diff\": null, \"total_10\": 313.2, \"daily_positive\": 72.0}, {\"state\": \"MA\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 256, \"negative\": 2015.0, \"pending\": null, \"death\": null, \"total\": 2271, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 38.0, \"negative_diff\": 474.0, \"death_diff\": null, \"total_10\": 227.1, \"daily_positive\": 38.0}, {\"state\": \"MA\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 218, \"negative\": 1541.0, \"pending\": null, \"death\": null, \"total\": 1759, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 54.0, \"negative_diff\": 1189.0, \"death_diff\": null, \"total_10\": 175.9, \"daily_positive\": 54.0}, {\"state\": \"MA\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 164, \"negative\": 352.0, \"pending\": null, \"death\": null, \"total\": 516, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 26.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 51.6, \"daily_positive\": 26.0}, {\"state\": \"MA\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 138, \"negative\": 352.0, \"pending\": null, \"death\": null, \"total\": 490, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 49.0, \"daily_positive\": 0.0}, {\"state\": \"MA\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 138, \"negative\": 352.0, \"pending\": null, \"death\": null, \"total\": 490, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 15.0, \"negative_diff\": 260.0, \"death_diff\": null, \"total_10\": 49.0, \"daily_positive\": 15.0}, {\"state\": \"MA\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 123, \"negative\": 92.0, \"pending\": null, \"death\": null, \"total\": 215, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 28.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 21.5, \"daily_positive\": 28.0}, {\"state\": \"MA\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 95, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 95, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 3.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 9.5, \"daily_positive\": 3.0}, {\"state\": \"MA\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 92, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 92, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 9.2, \"daily_positive\": 0.0}, {\"state\": \"MA\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 92, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 92, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 51.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 9.2, \"daily_positive\": 51.0}, {\"state\": \"MA\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 41, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 41, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 28.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 4.1, \"daily_positive\": 28.0}, {\"state\": \"MA\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 13, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 13, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 1.3, \"daily_positive\": 0.0}, {\"state\": \"MA\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 13, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 13, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 1.3, \"daily_positive\": 5.0}, {\"state\": \"MA\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 8, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 8, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 6.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.8, \"daily_positive\": 6.0}, {\"state\": \"MA\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 0.0}, {\"state\": \"MA\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": null}], \"data-2044206653abf4cf683f7eb7b0e2e7cf\": [{\"state\": \"CA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1063, \"negative\": 10424.0, \"pending\": null, \"death\": 20.0, \"total\": 11487, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 139.0, \"negative_diff\": 1637.0, \"death_diff\": 2.0, \"total_10\": 1148.7, \"daily_positive\": 139.0}, {\"state\": \"CA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 924, \"negative\": 8787.0, \"pending\": null, \"death\": 18.0, \"total\": 9711, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 313.0, \"negative_diff\": 806.0, \"death_diff\": 5.0, \"total_10\": 971.1, \"daily_positive\": 313.0}, {\"state\": \"CA\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 611, \"negative\": 7981.0, \"pending\": null, \"death\": 13.0, \"total\": 8592, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 128.0, \"negative_diff\": 0.0, \"death_diff\": 2.0, \"total_10\": 859.2, \"daily_positive\": 128.0}, {\"state\": \"CA\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 483, \"negative\": 7981.0, \"pending\": null, \"death\": 11.0, \"total\": 8407, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 148.0, \"negative_diff\": 0.0, \"death_diff\": 5.0, \"total_10\": 840.7, \"daily_positive\": 148.0}, {\"state\": \"CA\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 335, \"negative\": 7981.0, \"pending\": null, \"death\": 6.0, \"total\": 8316, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 42.0, \"negative_diff\": 7065.0, \"death_diff\": 1.0, \"total_10\": 831.6, \"daily_positive\": 42.0}, {\"state\": \"CA\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 293, \"negative\": 916.0, \"pending\": null, \"death\": 5.0, \"total\": 1209, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 41.0, \"negative_diff\": 0.0, \"death_diff\": 0.0, \"total_10\": 120.9, \"daily_positive\": 41.0}, {\"state\": \"CA\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 252, \"negative\": 916.0, \"pending\": null, \"death\": 5.0, \"total\": 1168, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 50.0, \"negative_diff\": 0.0, \"death_diff\": 1.0, \"total_10\": 116.8, \"daily_positive\": 50.0}, {\"state\": \"CA\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 202, \"negative\": 916.0, \"pending\": null, \"death\": 4.0, \"total\": 1118, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": 0.0, \"total_10\": 111.8, \"daily_positive\": 0.0}, {\"state\": \"CA\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 202, \"negative\": 916.0, \"pending\": null, \"death\": 4.0, \"total\": 1118, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 45.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 111.8, \"daily_positive\": 45.0}, {\"state\": \"CA\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 157, \"negative\": 916.0, \"pending\": null, \"death\": null, \"total\": 1073, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 24.0, \"negative_diff\": 226.0, \"death_diff\": null, \"total_10\": 107.3, \"daily_positive\": 24.0}, {\"state\": \"CA\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 133, \"negative\": 690.0, \"pending\": null, \"death\": null, \"total\": 823, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 19.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 82.3, \"daily_positive\": 19.0}, {\"state\": \"CA\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 114, \"negative\": 690.0, \"pending\": null, \"death\": null, \"total\": 804, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 26.0, \"negative_diff\": 228.0, \"death_diff\": null, \"total_10\": 80.4, \"daily_positive\": 26.0}, {\"state\": \"CA\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 88, \"negative\": 462.0, \"pending\": null, \"death\": null, \"total\": 550, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 19.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 55.0, \"daily_positive\": 19.0}, {\"state\": \"CA\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 69, \"negative\": 462.0, \"pending\": null, \"death\": null, \"total\": 531, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 9.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 53.1, \"daily_positive\": 9.0}, {\"state\": \"CA\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 60, \"negative\": 462.0, \"pending\": null, \"death\": null, \"total\": 522, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 7.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 52.2, \"daily_positive\": 7.0}, {\"state\": \"CA\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 53, \"negative\": 462.0, \"pending\": null, \"death\": null, \"total\": 515, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 51.5, \"daily_positive\": 0.0}, {\"state\": \"CA\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 53, \"negative\": 462.0, \"pending\": null, \"death\": null, \"total\": 515, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 51.5, \"daily_positive\": null}], \"data-15c49aeabdb5b7acee8110bdf90966fc\": [{\"state\": \"OK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 49, \"negative\": 538.0, \"pending\": 374.0, \"death\": 1.0, \"total\": 961, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": 72.0, \"death_diff\": 0.0, \"total_10\": 96.1, \"daily_positive\": 5.0}, {\"state\": \"OK\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 44, \"negative\": 466.0, \"pending\": 250.0, \"death\": 1.0, \"total\": 760, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 15.0, \"negative_diff\": 88.0, \"death_diff\": null, \"total_10\": 76.0, \"daily_positive\": 15.0}, {\"state\": \"OK\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 29, \"negative\": 378.0, \"pending\": 110.0, \"death\": null, \"total\": 517, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 12.0, \"negative_diff\": 131.0, \"death_diff\": null, \"total_10\": 51.7, \"daily_positive\": 12.0}, {\"state\": \"OK\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 17, \"negative\": 247.0, \"pending\": 82.0, \"death\": null, \"total\": 346, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 7.0, \"negative_diff\": 73.0, \"death_diff\": null, \"total_10\": 34.6, \"daily_positive\": 7.0}, {\"state\": \"OK\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 10, \"negative\": 174.0, \"pending\": 29.0, \"death\": null, \"total\": 213, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 56.0, \"death_diff\": null, \"total_10\": 21.3, \"daily_positive\": 1.0}, {\"state\": \"OK\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 9, \"negative\": 118.0, \"pending\": 12.0, \"death\": null, \"total\": 139, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": 82.0, \"death_diff\": null, \"total_10\": 13.9, \"daily_positive\": 5.0}, {\"state\": \"OK\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 4, \"negative\": 36.0, \"pending\": 37.0, \"death\": null, \"total\": 77, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 7.7, \"daily_positive\": 1.0}, {\"state\": \"OK\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 3, \"negative\": 36.0, \"pending\": 37.0, \"death\": null, \"total\": 76, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 7.6, \"daily_positive\": 0.0}, {\"state\": \"OK\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 3, \"negative\": 36.0, \"pending\": 4.0, \"death\": null, \"total\": 43, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 21.0, \"death_diff\": null, \"total_10\": 4.3, \"daily_positive\": 1.0}, {\"state\": \"OK\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 2, \"negative\": 15.0, \"pending\": 11.0, \"death\": null, \"total\": 28, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 2.8, \"daily_positive\": 0.0}, {\"state\": \"OK\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 2, \"negative\": 15.0, \"pending\": 11.0, \"death\": null, \"total\": 28, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 7.0, \"death_diff\": null, \"total_10\": 2.8, \"daily_positive\": 1.0}, {\"state\": \"OK\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 1, \"negative\": 8.0, \"pending\": 10.0, \"death\": null, \"total\": 19, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 1.9, \"daily_positive\": 0.0}, {\"state\": \"OK\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 1, \"negative\": 8.0, \"pending\": 2.0, \"death\": null, \"total\": 11, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 1.1, \"daily_positive\": 0.0}, {\"state\": \"OK\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 1, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 1, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.1, \"daily_positive\": null}], \"data-2480c6153905f8996f1be25f2c4ce853\": [{\"state\": \"LA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 479, \"negative\": 568.0, \"pending\": null, \"death\": 12.0, \"total\": 1047, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 132.0, \"negative_diff\": 110.0, \"death_diff\": 4.0, \"total_10\": 104.7, \"daily_positive\": 132.0}, {\"state\": \"LA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 347, \"negative\": 458.0, \"pending\": null, \"death\": 8.0, \"total\": 805, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 107.0, \"negative_diff\": 123.0, \"death_diff\": 2.0, \"total_10\": 80.5, \"daily_positive\": 107.0}, {\"state\": \"LA\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 240, \"negative\": 335.0, \"pending\": null, \"death\": 6.0, \"total\": 575, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 69.0, \"negative_diff\": 49.0, \"death_diff\": 2.0, \"total_10\": 57.5, \"daily_positive\": 69.0}, {\"state\": \"LA\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 171, \"negative\": 286.0, \"pending\": null, \"death\": 4.0, \"total\": 457, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 57.0, \"negative_diff\": 98.0, \"death_diff\": 2.0, \"total_10\": 45.7, \"daily_positive\": 57.0}, {\"state\": \"LA\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 114, \"negative\": 188.0, \"pending\": null, \"death\": 2.0, \"total\": 302, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 23.0, \"negative_diff\": 32.0, \"death_diff\": 0.0, \"total_10\": 30.2, \"daily_positive\": 23.0}, {\"state\": \"LA\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 91, \"negative\": 156.0, \"pending\": null, \"death\": 2.0, \"total\": 247, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 22.0, \"negative_diff\": 47.0, \"death_diff\": null, \"total_10\": 24.7, \"daily_positive\": 22.0}, {\"state\": \"LA\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 69, \"negative\": 109.0, \"pending\": null, \"death\": null, \"total\": 178, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 33.0, \"negative_diff\": 72.0, \"death_diff\": null, \"total_10\": 17.8, \"daily_positive\": 33.0}, {\"state\": \"LA\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 36, \"negative\": 37.0, \"pending\": null, \"death\": null, \"total\": 73, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 22.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 7.3, \"daily_positive\": 22.0}, {\"state\": \"LA\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 14, \"negative\": 37.0, \"pending\": null, \"death\": null, \"total\": 51, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 8.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 5.1, \"daily_positive\": 8.0}, {\"state\": \"LA\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 6, \"negative\": 37.0, \"pending\": null, \"death\": null, \"total\": 43, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": 26.0, \"death_diff\": null, \"total_10\": 4.3, \"daily_positive\": 5.0}, {\"state\": \"LA\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 1, \"negative\": 11.0, \"pending\": null, \"death\": null, \"total\": 12, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 6.0, \"death_diff\": null, \"total_10\": 1.2, \"daily_positive\": 0.0}, {\"state\": \"LA\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 1, \"negative\": 5.0, \"pending\": null, \"death\": null, \"total\": 6, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 0.0, \"death_diff\": null, \"total_10\": 0.6, \"daily_positive\": 1.0}, {\"state\": \"LA\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 0, \"negative\": 5.0, \"pending\": null, \"death\": null, \"total\": 5, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.5, \"daily_positive\": 0.0}, {\"state\": \"LA\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 0, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.0, \"daily_positive\": null}], \"data-c4deee1167555a60ac3fe96783b25881\": [{\"state\": \"FL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 520, \"negative\": 1870.0, \"pending\": 1026.0, \"death\": 10.0, \"total\": 3416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 130.0, \"negative_diff\": 337.0, \"death_diff\": 2.0, \"total_10\": 341.6, \"daily_positive\": 130.0}, {\"state\": \"FL\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 390, \"negative\": 1533.0, \"pending\": 1019.0, \"death\": 8.0, \"total\": 2942, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 76.0, \"negative_diff\": 308.0, \"death_diff\": 1.0, \"total_10\": 294.2, \"daily_positive\": 76.0}, {\"state\": \"FL\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 314, \"negative\": 1225.0, \"pending\": 954.0, \"death\": 7.0, \"total\": 2493, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 128.0, \"negative_diff\": 285.0, \"death_diff\": 1.0, \"total_10\": 249.3, \"daily_positive\": 128.0}, {\"state\": \"FL\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 186, \"negative\": 940.0, \"pending\": 872.0, \"death\": 6.0, \"total\": 1998, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 45.0, \"negative_diff\": 256.0, \"death_diff\": 2.0, \"total_10\": 199.8, \"daily_positive\": 45.0}, {\"state\": \"FL\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 141, \"negative\": 684.0, \"pending\": 514.0, \"death\": 4.0, \"total\": 1339, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 25.0, \"negative_diff\": 6.0, \"death_diff\": 0.0, \"total_10\": 133.9, \"daily_positive\": 25.0}, {\"state\": \"FL\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 116, \"negative\": 678.0, \"pending\": 454.0, \"death\": 4.0, \"total\": 1248, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 39.0, \"negative_diff\": 200.0, \"death_diff\": 1.0, \"total_10\": 124.8, \"daily_positive\": 39.0}, {\"state\": \"FL\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 77, \"negative\": 478.0, \"pending\": 221.0, \"death\": 3.0, \"total\": 776, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 27.0, \"negative_diff\": 0.0, \"death_diff\": 1.0, \"total_10\": 77.6, \"daily_positive\": 27.0}, {\"state\": \"FL\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 50, \"negative\": 478.0, \"pending\": 221.0, \"death\": 2.0, \"total\": 749, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 18.0, \"negative_diff\": 177.0, \"death_diff\": 0.0, \"total_10\": 74.9, \"daily_positive\": 18.0}, {\"state\": \"FL\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 32, \"negative\": 301.0, \"pending\": 147.0, \"death\": 2.0, \"total\": 480, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 4.0, \"negative_diff\": 0.0, \"death_diff\": 0.0, \"total_10\": 48.0, \"daily_positive\": 4.0}, {\"state\": \"FL\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 28, \"negative\": 301.0, \"pending\": 147.0, \"death\": 2.0, \"total\": 476, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 9.0, \"negative_diff\": 79.0, \"death_diff\": null, \"total_10\": 47.6, \"daily_positive\": 9.0}, {\"state\": \"FL\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 19, \"negative\": 222.0, \"pending\": 155.0, \"death\": null, \"total\": 396, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 82.0, \"death_diff\": null, \"total_10\": 39.6, \"daily_positive\": 1.0}, {\"state\": \"FL\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 18, \"negative\": 140.0, \"pending\": 115.0, \"death\": null, \"total\": 273, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 22.0, \"death_diff\": null, \"total_10\": 27.3, \"daily_positive\": 1.0}, {\"state\": \"FL\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 17, \"negative\": 118.0, \"pending\": 108.0, \"death\": null, \"total\": 243, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 3.0, \"negative_diff\": 18.0, \"death_diff\": null, \"total_10\": 24.3, \"daily_positive\": 3.0}, {\"state\": \"FL\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 14, \"negative\": 100.0, \"pending\": 88.0, \"death\": null, \"total\": 202, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": 45.0, \"death_diff\": null, \"total_10\": 20.2, \"daily_positive\": 5.0}, {\"state\": \"FL\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 9, \"negative\": 55.0, \"pending\": 51.0, \"death\": null, \"total\": 115, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 24.0, \"death_diff\": null, \"total_10\": 11.5, \"daily_positive\": 0.0}, {\"state\": \"FL\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 9, \"negative\": 31.0, \"pending\": 69.0, \"death\": null, \"total\": 109, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 7.0, \"negative_diff\": 7.0, \"death_diff\": null, \"total_10\": 10.9, \"daily_positive\": 7.0}, {\"state\": \"FL\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 2, \"negative\": 24.0, \"pending\": 16.0, \"death\": null, \"total\": 42, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 4.2, \"daily_positive\": null}], \"data-66a15f0a91cacd8abf8cfa13204a7e81\": [{\"state\": \"NJ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 890, \"negative\": 264.0, \"pending\": 86.0, \"death\": 11.0, \"total\": 1240, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 148.0, \"negative_diff\": 54.0, \"death_diff\": 2.0, \"total_10\": 124.0, \"daily_positive\": 148.0}, {\"state\": \"NJ\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 742, \"negative\": 210.0, \"pending\": 74.0, \"death\": 9.0, \"total\": 1026, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 315.0, \"negative_diff\": 20.0, \"death_diff\": 4.0, \"total_10\": 102.6, \"daily_positive\": 315.0}, {\"state\": \"NJ\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 427, \"negative\": 190.0, \"pending\": 21.0, \"death\": 5.0, \"total\": 638, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 160.0, \"negative_diff\": 27.0, \"death_diff\": 2.0, \"total_10\": 63.8, \"daily_positive\": 160.0}, {\"state\": \"NJ\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 267, \"negative\": 163.0, \"pending\": 55.0, \"death\": 3.0, \"total\": 485, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 89.0, \"negative_diff\": 43.0, \"death_diff\": 1.0, \"total_10\": 48.5, \"daily_positive\": 89.0}, {\"state\": \"NJ\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 178, \"negative\": 120.0, \"pending\": 20.0, \"death\": 2.0, \"total\": 218, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 80.0, \"negative_diff\": 0.0, \"death_diff\": 0.0, \"total_10\": 21.8, \"daily_positive\": 80.0}, {\"state\": \"NJ\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 98, \"negative\": 120.0, \"pending\": 34.0, \"death\": 2.0, \"total\": 252, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 48.0, \"negative_diff\": 23.0, \"death_diff\": 1.0, \"total_10\": 25.2, \"daily_positive\": 48.0}, {\"state\": \"NJ\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 50, \"negative\": 97.0, \"pending\": 80.0, \"death\": 1.0, \"total\": 227, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": 0.0, \"total_10\": 22.7, \"daily_positive\": 0.0}, {\"state\": \"NJ\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 50, \"negative\": 97.0, \"pending\": 80.0, \"death\": 1.0, \"total\": 227, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 20.0, \"negative_diff\": 23.0, \"death_diff\": 0.0, \"total_10\": 22.7, \"daily_positive\": 20.0}, {\"state\": \"NJ\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 30, \"negative\": 74.0, \"pending\": 20.0, \"death\": 1.0, \"total\": 124, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 6.0, \"negative_diff\": 17.0, \"death_diff\": 0.0, \"total_10\": 12.4, \"daily_positive\": 6.0}, {\"state\": \"NJ\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 24, \"negative\": 57.0, \"pending\": 20.0, \"death\": 1.0, \"total\": 100, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 9.0, \"negative_diff\": 13.0, \"death_diff\": null, \"total_10\": 10.0, \"daily_positive\": 9.0}, {\"state\": \"NJ\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 15, \"negative\": 44.0, \"pending\": 20.0, \"death\": null, \"total\": 79, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 4.0, \"negative_diff\": 9.0, \"death_diff\": null, \"total_10\": 7.9, \"daily_positive\": 4.0}, {\"state\": \"NJ\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 11, \"negative\": 35.0, \"pending\": 14.0, \"death\": null, \"total\": 60, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": 4.0, \"death_diff\": null, \"total_10\": 6.0, \"daily_positive\": 5.0}, {\"state\": \"NJ\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 6, \"negative\": 31.0, \"pending\": 0.0, \"death\": null, \"total\": 37, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 2.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 3.7, \"daily_positive\": 2.0}, {\"state\": \"NJ\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 4, \"negative\": null, \"pending\": 1.0, \"death\": null, \"total\": 5, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 3.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.5, \"daily_positive\": 3.0}, {\"state\": \"NJ\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 1, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 1, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.1, \"daily_positive\": 0.0}, {\"state\": \"NJ\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 1, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 1, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.1, \"daily_positive\": null}], \"data-ddffbf8d2dd76c1c297388ebe03e44ee\": [{\"state\": \"NC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 137, \"negative\": 3096.0, \"pending\": null, \"death\": 0.0, \"total\": 3233, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 40.0, \"negative_diff\": 688.0, \"death_diff\": 0.0, \"total_10\": 323.3, \"daily_positive\": 40.0}, {\"state\": \"NC\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 97, \"negative\": 2408.0, \"pending\": null, \"death\": 0.0, \"total\": 2505, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 34.0, \"negative_diff\": 621.0, \"death_diff\": 0.0, \"total_10\": 250.5, \"daily_positive\": 34.0}, {\"state\": \"NC\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 63, \"negative\": 1787.0, \"pending\": null, \"death\": 0.0, \"total\": 1850, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 23.0, \"negative_diff\": 1313.0, \"death_diff\": 0.0, \"total_10\": 185.0, \"daily_positive\": 23.0}, {\"state\": \"NC\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 40, \"negative\": 474.0, \"pending\": null, \"death\": 0.0, \"total\": 514, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 7.0, \"negative_diff\": 178.0, \"death_diff\": 0.0, \"total_10\": 51.4, \"daily_positive\": 7.0}, {\"state\": \"NC\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 33, \"negative\": 296.0, \"pending\": 151.0, \"death\": 0.0, \"total\": 480, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": 69.0, \"death_diff\": null, \"total_10\": 48.0, \"daily_positive\": 1.0}, {\"state\": \"NC\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 32, \"negative\": 227.0, \"pending\": 151.0, \"death\": null, \"total\": 410, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 9.0, \"negative_diff\": 90.0, \"death_diff\": null, \"total_10\": 41.0, \"daily_positive\": 9.0}, {\"state\": \"NC\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 23, \"negative\": 137.0, \"pending\": null, \"death\": null, \"total\": 160, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 8.0, \"negative_diff\": 51.0, \"death_diff\": null, \"total_10\": 16.0, \"daily_positive\": 8.0}, {\"state\": \"NC\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 15, \"negative\": 86.0, \"pending\": null, \"death\": null, \"total\": 101, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 3.0, \"negative_diff\": 26.0, \"death_diff\": null, \"total_10\": 10.1, \"daily_positive\": 3.0}, {\"state\": \"NC\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 12, \"negative\": 60.0, \"pending\": null, \"death\": null, \"total\": 72, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 7.2, \"daily_positive\": 5.0}, {\"state\": \"NC\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 7, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 7, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.7, \"daily_positive\": 0.0}, {\"state\": \"NC\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 7, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 7, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.7, \"daily_positive\": 5.0}, {\"state\": \"NC\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 0.0}, {\"state\": \"NC\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 0.0}, {\"state\": \"NC\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 0.0}, {\"state\": \"NC\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 1.0}, {\"state\": \"NC\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 1, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 1, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.1, \"daily_positive\": 0.0}, {\"state\": \"NC\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 1, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 1, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.1, \"daily_positive\": null}], \"data-3d1b17d38cf3d74b0371cfc3b471f3bc\": [{\"state\": \"GA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 420, \"negative\": 1966.0, \"pending\": null, \"death\": 13.0, \"total\": 2386, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"positive_diff\": 133.0, \"negative_diff\": 422.0, \"death_diff\": 3.0, \"total_10\": 238.6, \"daily_positive\": 133.0}, {\"state\": \"GA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 287, \"negative\": 1544.0, \"pending\": null, \"death\": 10.0, \"total\": 1831, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"positive_diff\": 90.0, \"negative_diff\": 233.0, \"death_diff\": 9.0, \"total_10\": 183.1, \"daily_positive\": 90.0}, {\"state\": \"GA\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 197, \"negative\": 1311.0, \"pending\": null, \"death\": 1.0, \"total\": 1508, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"positive_diff\": 51.0, \"negative_diff\": null, \"death_diff\": 0.0, \"total_10\": 150.8, \"daily_positive\": 51.0}, {\"state\": \"GA\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 146, \"negative\": null, \"pending\": null, \"death\": 1.0, \"total\": 146, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"positive_diff\": 25.0, \"negative_diff\": null, \"death_diff\": 0.0, \"total_10\": 14.6, \"daily_positive\": 25.0}, {\"state\": \"GA\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 121, \"negative\": null, \"pending\": null, \"death\": 1.0, \"total\": 121, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"positive_diff\": 22.0, \"negative_diff\": null, \"death_diff\": 0.0, \"total_10\": 12.1, \"daily_positive\": 22.0}, {\"state\": \"GA\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 99, \"negative\": null, \"pending\": null, \"death\": 1.0, \"total\": 99, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"positive_diff\": 33.0, \"negative_diff\": null, \"death_diff\": 0.0, \"total_10\": 9.9, \"daily_positive\": 33.0}, {\"state\": \"GA\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 66, \"negative\": null, \"pending\": null, \"death\": 1.0, \"total\": 66, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"positive_diff\": 24.0, \"negative_diff\": null, \"death_diff\": 0.0, \"total_10\": 6.6, \"daily_positive\": 24.0}, {\"state\": \"GA\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 42, \"negative\": null, \"pending\": null, \"death\": 1.0, \"total\": 42, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"positive_diff\": 11.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 4.2, \"daily_positive\": 11.0}, {\"state\": \"GA\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 31, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 31, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"positive_diff\": 9.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 3.1, \"daily_positive\": 9.0}, {\"state\": \"GA\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 22, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 22, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 2.2, \"daily_positive\": 5.0}, {\"state\": \"GA\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 17, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 17, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 1.7, \"daily_positive\": 5.0}, {\"state\": \"GA\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 12, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 12, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"positive_diff\": 5.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 1.2, \"daily_positive\": 5.0}, {\"state\": \"GA\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 7, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 7, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"positive_diff\": 1.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.7, \"daily_positive\": 1.0}, {\"state\": \"GA\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 6, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 6, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"positive_diff\": 4.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.6, \"daily_positive\": 4.0}, {\"state\": \"GA\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 0.0}, {\"state\": \"GA\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"positive_diff\": 0.0, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": 0.0}, {\"state\": \"GA\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 2, \"negative\": null, \"pending\": null, \"death\": null, \"total\": 2, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"total_10\": 0.2, \"daily_positive\": null}]}}, {\"mode\": \"vega-lite\"});\n", "</script>" ], "text/plain": [ "alt.HConcatChart(...)" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# produce the charts for a few states\n", "\n", "charts=[]\n", "for state in ['WA', 'NY', 'MA', 'CA', 'OK','LA','FL','NJ','NC','GA']: \n", " state_df = tdf_diff[tdf_diff['state'] == state].copy()\n", "\n", " state_df.loc[:,'daily_positive'] = state_df['positive'][::-1].diff()\n", " state_df.loc[:,'total_10'] = state_df['total']/10.\n", "\n", " base = alt.Chart(state_df, title=state).encode(alt.X('date', axis=alt.Axis(title='Date'))).properties(width=250, height=150)\n", " dailies = base.mark_bar(size=10).encode(alt.Y('daily_positive', axis=alt.Axis(title='Daily positive')))\n", "\n", " totals = base.mark_line(color='lightgreen').encode(alt.Y('total_10', axis=alt.Axis(title='Tests/10'))) \n", " positives = totals.mark_line(color='red').encode(alt.Y('positive', axis=alt.Axis(title='# Positive')))\n", " cumulative = totals + positives\n", "\n", " charts.append(alt.layer(dailies, cumulative).resolve_scale(y='independent'))\n", "\n", "\n", "alt.hconcat(*charts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Counts per 100k" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "pop_df = pd.read_csv('../../data/geodata/us_pop_fung_2019.csv').set_index('ST')" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Most recent test date 2020-03-20 00:00:00\n", "56 states/territories have data on this date.\n" ] } ], "source": [ "most_recent_test_date = data_df['date'].max()\n", "most_recent_df = data_df[data_df['date'] == most_recent_test_date].set_index('state')\n", "print(\"Most recent test date\", most_recent_test_date)\n", "print(len(most_recent_df), \"states/territories have data on this date.\")" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [], "source": [ "#create a couple of columns for testing rate analysis\n", "most_recent_df['total/100k'] = (most_recent_df['total'] / pop_df['Population']) * 100000\n", "most_recent_df['total/positive'] = (most_recent_df['total'] / most_recent_df['positive'])\n", "most_recent_df = most_recent_df.reset_index()" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>state</th>\n", " <th>date</th>\n", " <th>positive</th>\n", " <th>negative</th>\n", " <th>pending</th>\n", " <th>death</th>\n", " <th>total</th>\n", " <th>dateChecked</th>\n", " <th>total/100k</th>\n", " <th>total/positive</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>AK</td>\n", " <td>2020-03-20</td>\n", " <td>12</td>\n", " <td>686.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>698</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>95.414499</td>\n", " <td>58.166667</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>AL</td>\n", " <td>2020-03-20</td>\n", " <td>81</td>\n", " <td>28.0</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>109</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>2.223045</td>\n", " <td>1.345679</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>AR</td>\n", " <td>2020-03-20</td>\n", " <td>96</td>\n", " <td>351.0</td>\n", " <td>203.0</td>\n", " <td>NaN</td>\n", " <td>650</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>21.538691</td>\n", " <td>6.770833</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>AS</td>\n", " <td>2020-03-20</td>\n", " <td>0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>0</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>AZ</td>\n", " <td>2020-03-20</td>\n", " <td>65</td>\n", " <td>211.0</td>\n", " <td>101.0</td>\n", " <td>0.0</td>\n", " <td>377</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>5.179484</td>\n", " <td>5.800000</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " state date positive negative pending death total \\\n", "0 AK 2020-03-20 12 686.0 NaN NaN 698 \n", "1 AL 2020-03-20 81 28.0 NaN 0.0 109 \n", "2 AR 2020-03-20 96 351.0 203.0 NaN 650 \n", "3 AS 2020-03-20 0 NaN NaN 0.0 0 \n", "4 AZ 2020-03-20 65 211.0 101.0 0.0 377 \n", "\n", " dateChecked total/100k total/positive \n", "0 2020-03-20T20:00:00Z 95.414499 58.166667 \n", "1 2020-03-20T20:00:00Z 2.223045 1.345679 \n", "2 2020-03-20T20:00:00Z 21.538691 6.770833 \n", "3 2020-03-20T20:00:00Z NaN NaN \n", "4 2020-03-20T20:00:00Z 5.179484 5.800000 " ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "most_recent_df.head()" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "<div id=\"altair-viz-cd5d7f00b447409eab50e64235fc1cbb\"></div>\n", "<script type=\"text/javascript\">\n", " (function(spec, embedOpt){\n", " const outputDiv = document.getElementById(\"altair-viz-cd5d7f00b447409eab50e64235fc1cbb\");\n", " const paths = {\n", " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n", " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", " };\n", "\n", " function loadScript(lib) {\n", " return new Promise(function(resolve, reject) {\n", " var s = document.createElement('script');\n", " s.src = paths[lib];\n", " s.async = true;\n", " s.onload = () => resolve(paths[lib]);\n", " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " });\n", " }\n", "\n", " function showError(err) {\n", " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", " throw err;\n", " }\n", "\n", " function displayChart(vegaEmbed) {\n", " vegaEmbed(outputDiv, spec, embedOpt)\n", " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", " }\n", "\n", " if(typeof define === \"function\" && define.amd) {\n", " requirejs.config({paths});\n", " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", " } else if (typeof vegaEmbed === \"function\") {\n", " displayChart(vegaEmbed);\n", " } else {\n", " loadScript(\"vega\")\n", " .then(() => loadScript(\"vega-lite\"))\n", " .then(() => loadScript(\"vega-embed\"))\n", " .catch(showError)\n", " .then(() => displayChart(vegaEmbed));\n", " }\n", " })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-c1e8abbd60f610511423df584e195bc6\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"state\", \"sort\": \"y\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"total/100k\"}}, \"title\": \"Tests per 100k\", \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-c1e8abbd60f610511423df584e195bc6\": [{\"state\": \"AL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 81, \"negative\": 28.0, \"pending\": null, \"death\": 0.0, \"total\": 109, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 2.2230448167874557, \"total/positive\": 1.345679012345679}, {\"state\": \"OH\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 169, \"negative\": 140.0, \"pending\": null, \"death\": 1.0, \"total\": 309, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 2.6434883780616127, \"total/positive\": 1.8284023668639053}, {\"state\": \"MD\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 149, \"negative\": 94.0, \"pending\": null, \"death\": 1.0, \"total\": 243, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 4.0193989757975945, \"total/positive\": 1.6308724832214765}, {\"state\": \"AZ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 65, \"negative\": 211.0, \"pending\": 101.0, \"death\": 0.0, \"total\": 377, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 5.179484241522235, \"total/positive\": 5.8}, {\"state\": \"MO\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 47, \"negative\": 369.0, \"pending\": null, \"death\": 1.0, \"total\": 416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 6.7780835881088946, \"total/positive\": 8.851063829787234}, {\"state\": \"DE\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 38, \"negative\": 36.0, \"pending\": null, \"death\": 0.0, \"total\": 74, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 7.599377261841679, \"total/positive\": 1.9473684210526316}, {\"state\": \"IN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 79, \"negative\": 475.0, \"pending\": null, \"death\": 2.0, \"total\": 554, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 8.22908464504794, \"total/positive\": 7.012658227848101}, {\"state\": \"HI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 26, \"negative\": 124.0, \"pending\": 9.0, \"death\": null, \"total\": 159, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 11.229828685078877, \"total/positive\": 6.115384615384615}, {\"state\": \"TN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 228, \"negative\": 563.0, \"pending\": null, \"death\": null, \"total\": 791, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 11.575879671730883, \"total/positive\": 3.469298245614035}, {\"state\": \"WV\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7, \"negative\": 219.0, \"pending\": 13.0, \"death\": 0.0, \"total\": 239, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 13.373270357726588, \"total/positive\": 34.142857142857146}, {\"state\": \"NJ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 890, \"negative\": 264.0, \"pending\": 86.0, \"death\": 11.0, \"total\": 1240, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 13.960520997636843, \"total/positive\": 1.3932584269662922}, {\"state\": \"NE\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 32, \"negative\": 240.0, \"pending\": null, \"death\": 0.0, \"total\": 272, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 14.061149457611839, \"total/positive\": 8.5}, {\"state\": \"KY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 47, \"negative\": 592.0, \"pending\": null, \"death\": 1.0, \"total\": 639, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 14.302747761530442, \"total/positive\": 13.595744680851064}, {\"state\": \"KS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 44, \"negative\": 417.0, \"pending\": null, \"death\": 1.0, \"total\": 461, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 15.823903636889122, \"total/positive\": 10.477272727272727}, {\"state\": \"FL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 520, \"negative\": 1870.0, \"pending\": 1026.0, \"death\": 10.0, \"total\": 3416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 15.904841371323243, \"total/positive\": 6.569230769230769}, {\"state\": \"SC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 81, \"negative\": 833.0, \"pending\": null, \"death\": 1.0, \"total\": 914, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 17.752005646458514, \"total/positive\": 11.283950617283951}, {\"state\": \"TX\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 194, \"negative\": 5083.0, \"pending\": null, \"death\": 5.0, \"total\": 5277, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 18.199136629095698, \"total/positive\": 27.201030927835053}, {\"state\": \"AR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 96, \"negative\": 351.0, \"pending\": 203.0, \"death\": null, \"total\": 650, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 21.53869094463728, \"total/positive\": 6.770833333333333}, {\"state\": \"IA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 45, \"negative\": 642.0, \"pending\": null, \"death\": null, \"total\": 687, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 21.77447726991794, \"total/positive\": 15.266666666666667}, {\"state\": \"PA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 268, \"negative\": 2574.0, \"pending\": null, \"death\": 1.0, \"total\": 2842, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 22.199675378568127, \"total/positive\": 10.604477611940299}, {\"state\": \"CT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 194, \"negative\": 604.0, \"pending\": null, \"death\": 3.0, \"total\": 798, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 22.382489824802324, \"total/positive\": 4.11340206185567}, {\"state\": \"GA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 420, \"negative\": 1966.0, \"pending\": null, \"death\": 13.0, \"total\": 2386, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 22.472496386364185, \"total/positive\": 5.680952380952381}, {\"state\": \"LA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 479, \"negative\": 568.0, \"pending\": null, \"death\": 12.0, \"total\": 1047, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 22.521970214210395, \"total/positive\": 2.18580375782881}, {\"state\": \"OK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 49, \"negative\": 538.0, \"pending\": 374.0, \"death\": 1.0, \"total\": 961, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 24.28625329829306, \"total/positive\": 19.612244897959183}, {\"state\": \"MS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 80, \"negative\": 695.0, \"pending\": null, \"death\": 1.0, \"total\": 775, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 26.040362898497353, \"total/positive\": 9.6875}, {\"state\": \"MI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 549, \"negative\": 2069.0, \"pending\": null, \"death\": 3.0, \"total\": 2618, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 26.214453656440657, \"total/positive\": 4.768670309653916}, {\"state\": \"VA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 114, \"negative\": 2211.0, \"pending\": null, \"death\": 2.0, \"total\": 2325, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 27.239116918373682, \"total/positive\": 20.394736842105264}, {\"state\": \"CA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1063, \"negative\": 10424.0, \"pending\": null, \"death\": 20.0, \"total\": 11487, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 29.072016525114265, \"total/positive\": 10.80620884289746}, {\"state\": \"NC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 137, \"negative\": 3096.0, \"pending\": null, \"death\": 0.0, \"total\": 3233, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 30.82545868244381, \"total/positive\": 23.598540145985403}, {\"state\": \"IL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 590, \"negative\": 3696.0, \"pending\": null, \"death\": 5.0, \"total\": 4286, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 33.82307878244176, \"total/positive\": 7.264406779661017}, {\"state\": \"ID\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 23, \"negative\": 590.0, \"pending\": null, \"death\": null, \"total\": 613, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 34.20634854204507, \"total/positive\": 26.652173913043477}, {\"state\": \"CO\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 277, \"negative\": 2675.0, \"pending\": null, \"death\": 3.0, \"total\": 2952, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 51.26124899630753, \"total/positive\": 10.657039711191336}, {\"state\": \"MA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 413, \"negative\": 3678.0, \"pending\": null, \"death\": 1.0, \"total\": 4091, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 58.86751901538858, \"total/positive\": 9.905569007263923}, {\"state\": \"OR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 114, \"negative\": 2003.0, \"pending\": 433.0, \"death\": 3.0, \"total\": 2550, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 60.45896176077361, \"total/positive\": 22.36842105263158}, {\"state\": \"WY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 19, \"negative\": 331.0, \"pending\": null, \"death\": null, \"total\": 350, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 60.47422156718081, \"total/positive\": 18.42105263157895}, {\"state\": \"WI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 206, \"negative\": 3455.0, \"pending\": null, \"death\": 3.0, \"total\": 3661, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 62.87748388388774, \"total/positive\": 17.771844660194176}, {\"state\": \"UT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 112, \"negative\": 2035.0, \"pending\": null, \"death\": 0.0, \"total\": 2147, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 66.9690619777302, \"total/positive\": 19.169642857142858}, {\"state\": \"NV\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 109, \"negative\": 1992.0, \"pending\": -3.0, \"death\": 1.0, \"total\": 2098, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 68.11343321572025, \"total/positive\": 19.24770642201835}, {\"state\": \"MN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 115, \"negative\": 3741.0, \"pending\": null, \"death\": null, \"total\": 3856, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 68.37325555993725, \"total/positive\": 33.530434782608694}, {\"state\": \"RI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 54, \"negative\": 654.0, \"pending\": 140.0, \"death\": null, \"total\": 848, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 80.0482555049695, \"total/positive\": 15.703703703703704}, {\"state\": \"DC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 71, \"negative\": 501.0, \"pending\": 1.0, \"death\": 1.0, \"total\": 573, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 81.1903382080598, \"total/positive\": 8.070422535211268}, {\"state\": \"MT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 16, \"negative\": 931.0, \"pending\": null, \"death\": null, \"total\": 947, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 88.60586576445249, \"total/positive\": 59.1875}, {\"state\": \"AK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 12, \"negative\": 686.0, \"pending\": null, \"death\": null, \"total\": 698, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 95.4144994497946, \"total/positive\": 58.166666666666664}, {\"state\": \"NH\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 44, \"negative\": 745.0, \"pending\": 631.0, \"death\": null, \"total\": 1420, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 104.43395692172822, \"total/positive\": 32.27272727272727}, {\"state\": \"SD\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 663.0, \"pending\": 270.0, \"death\": 1.0, \"total\": 947, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 107.04689603564763, \"total/positive\": 67.64285714285714}, {\"state\": \"ND\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 20, \"negative\": 800.0, \"pending\": null, \"death\": 0.0, \"total\": 820, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 107.60279347349692, \"total/positive\": 41.0}, {\"state\": \"VT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 29, \"negative\": 779.0, \"pending\": null, \"death\": 2.0, \"total\": 808, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 129.48946215398027, \"total/positive\": 27.862068965517242}, {\"state\": \"NY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7102, \"negative\": 25325.0, \"pending\": null, \"death\": 35.0, \"total\": 32427, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 166.6892760662174, \"total/positive\": 4.565896930442129}, {\"state\": \"ME\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 57, \"negative\": 2264.0, \"pending\": null, \"death\": null, \"total\": 2321, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 172.6662163408748, \"total/positive\": 40.719298245614034}, {\"state\": \"NM\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 43, \"negative\": 3771.0, \"pending\": null, \"death\": null, \"total\": 3814, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 181.893707116794, \"total/positive\": 88.69767441860465}, {\"state\": \"WA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1376, \"negative\": 19336.0, \"pending\": null, \"death\": 74.0, \"total\": 20712, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": 271.9933162553958, \"total/positive\": 15.05232558139535}, {\"state\": \"AS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": null, \"total/positive\": null}, {\"state\": \"GU\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 86.0, \"pending\": null, \"death\": null, \"total\": 100, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": null, \"total/positive\": 7.142857142857143}, {\"state\": \"MP\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": null, \"total/positive\": null}, {\"state\": \"PR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 114.0, \"pending\": 52.0, \"death\": null, \"total\": 180, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": null, \"total/positive\": 12.857142857142858}, {\"state\": \"VI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 3, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 3, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"total/100k\": null, \"total/positive\": 1.0}]}}, {\"mode\": \"vega-lite\"});\n", "</script>" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chart = alt.Chart(most_recent_df.sort_values('total/100k'), title=\"Tests per 100k\")\n", "chart.mark_bar().encode(alt.X('state', sort='y'), alt.Y('total/100k'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Tests per 100k Population & Total Positives" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [], "source": [ "#Load most recent data and city population counts\n", "data_df = pd.read_json('../../data/covidtracking/states-daily.json')\n", "data_df['date'] = pd.to_datetime(data_df['date'], format=\"%Y%m%d\")\n", "pop_df = pd.read_csv('../../data/geodata/us_pop_fung_2019.csv').set_index('ST')" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Most recent test date 2020-03-20 00:00:00\n", "56 states/territories have data on this date.\n" ] } ], "source": [ "most_recent_test_date = data_df['date'].max()\n", "most_recent_df = data_df[data_df['date'] == most_recent_test_date].set_index('state')\n", "print(\"Most recent test date\", most_recent_test_date)\n", "print(len(most_recent_df), \"states/territories have data on this date.\")" ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [], "source": [ "most_recent_df['tests/100k'] = round((most_recent_df['total'] / pop_df['Population']) * 100000,2)\n", "most_recent_df['pos/100k'] = round((most_recent_df['positive'] / pop_df['Population']) * 100000,2)\n", "most_recent_df['total/positive'] = round((most_recent_df['total'] / most_recent_df['positive']),2)\n", "most_recent_df = most_recent_df.reset_index()" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>state</th>\n", " <th>date</th>\n", " <th>positive</th>\n", " <th>negative</th>\n", " <th>pending</th>\n", " <th>death</th>\n", " <th>total</th>\n", " <th>dateChecked</th>\n", " <th>tests/100k</th>\n", " <th>pos/100k</th>\n", " <th>total/positive</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>AK</td>\n", " <td>2020-03-20</td>\n", " <td>12</td>\n", " <td>686.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>698</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>95.41</td>\n", " <td>1.64</td>\n", " <td>58.17</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>AL</td>\n", " <td>2020-03-20</td>\n", " <td>81</td>\n", " <td>28.0</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>109</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>2.22</td>\n", " <td>1.65</td>\n", " <td>1.35</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>AR</td>\n", " <td>2020-03-20</td>\n", " <td>96</td>\n", " <td>351.0</td>\n", " <td>203.0</td>\n", " <td>NaN</td>\n", " <td>650</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>21.54</td>\n", " <td>3.18</td>\n", " <td>6.77</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>AS</td>\n", " <td>2020-03-20</td>\n", " <td>0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>0</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>AZ</td>\n", " <td>2020-03-20</td>\n", " <td>65</td>\n", " <td>211.0</td>\n", " <td>101.0</td>\n", " <td>0.0</td>\n", " <td>377</td>\n", " <td>2020-03-20T20:00:00Z</td>\n", " <td>5.18</td>\n", " <td>0.89</td>\n", " <td>5.80</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " state date positive negative pending death total \\\n", "0 AK 2020-03-20 12 686.0 NaN NaN 698 \n", "1 AL 2020-03-20 81 28.0 NaN 0.0 109 \n", "2 AR 2020-03-20 96 351.0 203.0 NaN 650 \n", "3 AS 2020-03-20 0 NaN NaN 0.0 0 \n", "4 AZ 2020-03-20 65 211.0 101.0 0.0 377 \n", "\n", " dateChecked tests/100k pos/100k total/positive \n", "0 2020-03-20T20:00:00Z 95.41 1.64 58.17 \n", "1 2020-03-20T20:00:00Z 2.22 1.65 1.35 \n", "2 2020-03-20T20:00:00Z 21.54 3.18 6.77 \n", "3 2020-03-20T20:00:00Z NaN NaN NaN \n", "4 2020-03-20T20:00:00Z 5.18 0.89 5.80 " ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "most_recent_df.head()" ] }, { "cell_type": "code", "execution_count": 99, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "<div id=\"altair-viz-2185da6a40fd430e87aafaf4c171c923\"></div>\n", "<script type=\"text/javascript\">\n", " (function(spec, embedOpt){\n", " const outputDiv = document.getElementById(\"altair-viz-2185da6a40fd430e87aafaf4c171c923\");\n", " const paths = {\n", " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n", " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", " };\n", "\n", " function loadScript(lib) {\n", " return new Promise(function(resolve, reject) {\n", " var s = document.createElement('script');\n", " s.src = paths[lib];\n", " s.async = true;\n", " s.onload = () => resolve(paths[lib]);\n", " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " });\n", " }\n", "\n", " function showError(err) {\n", " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", " throw err;\n", " }\n", "\n", " function displayChart(vegaEmbed) {\n", " vegaEmbed(outputDiv, spec, embedOpt)\n", " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", " }\n", "\n", " if(typeof define === \"function\" && define.amd) {\n", " requirejs.config({paths});\n", " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", " } else if (typeof vegaEmbed === \"function\") {\n", " displayChart(vegaEmbed);\n", " } else {\n", " loadScript(\"vega\")\n", " .then(() => loadScript(\"vega-lite\"))\n", " .then(() => loadScript(\"vega-embed\"))\n", " .catch(showError)\n", " .then(() => displayChart(vegaEmbed));\n", " }\n", " })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"mark\": {\"type\": \"bar\", \"color\": \"lightgrey\"}, \"encoding\": {\"tooltip\": [{\"type\": \"nominal\", \"field\": \"state\"}, {\"type\": \"quantitative\", \"field\": \"pos/100k\"}, {\"type\": \"quantitative\", \"field\": \"tests/100k\"}, {\"type\": \"quantitative\", \"field\": \"positive\"}], \"x\": {\"type\": \"nominal\", \"field\": \"state\", \"sort\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"grid\": true, \"title\": \"Tests / 100k population\"}, \"field\": \"tests/100k\"}}, \"title\": \"COVID-19 in the States : tests and positive cases / 100k Population\"}, {\"mark\": {\"type\": \"circle\", \"color\": \"blue\", \"size\": 60}, \"encoding\": {\"tooltip\": [{\"type\": \"nominal\", \"field\": \"state\"}, {\"type\": \"quantitative\", \"field\": \"pos/100k\"}, {\"type\": \"quantitative\", \"field\": \"tests/100k\"}, {\"type\": \"quantitative\", \"field\": \"positive\"}], \"x\": {\"type\": \"nominal\", \"field\": \"state\", \"sort\": \"x\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"tickMinStep\": 5, \"title\": \"Positive COVID-19 Cases/100k population\"}, \"field\": \"pos/100k\"}}, \"title\": \"COVID-19 in the States : tests and positive cases / 100k Population\"}], \"data\": {\"name\": \"data-4c75d1ce0dd41789750ce2a59fa776ac\"}, \"height\": 600, \"resolve\": {\"scale\": {\"y\": \"independent\"}}, \"width\": 800, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-4c75d1ce0dd41789750ce2a59fa776ac\": [{\"state\": \"AL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 81, \"negative\": 28.0, \"pending\": null, \"death\": 0.0, \"total\": 109, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 2.22, \"pos/100k\": 1.65, \"total/positive\": 1.35}, {\"state\": \"OH\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 169, \"negative\": 140.0, \"pending\": null, \"death\": 1.0, \"total\": 309, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 2.64, \"pos/100k\": 1.45, \"total/positive\": 1.83}, {\"state\": \"MD\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 149, \"negative\": 94.0, \"pending\": null, \"death\": 1.0, \"total\": 243, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 4.02, \"pos/100k\": 2.46, \"total/positive\": 1.63}, {\"state\": \"AZ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 65, \"negative\": 211.0, \"pending\": 101.0, \"death\": 0.0, \"total\": 377, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 5.18, \"pos/100k\": 0.89, \"total/positive\": 5.8}, {\"state\": \"MO\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 47, \"negative\": 369.0, \"pending\": null, \"death\": 1.0, \"total\": 416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 6.78, \"pos/100k\": 0.77, \"total/positive\": 8.85}, {\"state\": \"DE\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 38, \"negative\": 36.0, \"pending\": null, \"death\": 0.0, \"total\": 74, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 7.6, \"pos/100k\": 3.9, \"total/positive\": 1.95}, {\"state\": \"IN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 79, \"negative\": 475.0, \"pending\": null, \"death\": 2.0, \"total\": 554, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 8.23, \"pos/100k\": 1.17, \"total/positive\": 7.01}, {\"state\": \"HI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 26, \"negative\": 124.0, \"pending\": 9.0, \"death\": null, \"total\": 159, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 11.23, \"pos/100k\": 1.84, \"total/positive\": 6.12}, {\"state\": \"TN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 228, \"negative\": 563.0, \"pending\": null, \"death\": null, \"total\": 791, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 11.58, \"pos/100k\": 3.34, \"total/positive\": 3.47}, {\"state\": \"WV\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7, \"negative\": 219.0, \"pending\": 13.0, \"death\": 0.0, \"total\": 239, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 13.37, \"pos/100k\": 0.39, \"total/positive\": 34.14}, {\"state\": \"NJ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 890, \"negative\": 264.0, \"pending\": 86.0, \"death\": 11.0, \"total\": 1240, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 13.96, \"pos/100k\": 10.02, \"total/positive\": 1.39}, {\"state\": \"NE\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 32, \"negative\": 240.0, \"pending\": null, \"death\": 0.0, \"total\": 272, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 14.06, \"pos/100k\": 1.65, \"total/positive\": 8.5}, {\"state\": \"KY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 47, \"negative\": 592.0, \"pending\": null, \"death\": 1.0, \"total\": 639, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 14.3, \"pos/100k\": 1.05, \"total/positive\": 13.6}, {\"state\": \"KS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 44, \"negative\": 417.0, \"pending\": null, \"death\": 1.0, \"total\": 461, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 15.82, \"pos/100k\": 1.51, \"total/positive\": 10.48}, {\"state\": \"FL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 520, \"negative\": 1870.0, \"pending\": 1026.0, \"death\": 10.0, \"total\": 3416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 15.9, \"pos/100k\": 2.42, \"total/positive\": 6.57}, {\"state\": \"SC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 81, \"negative\": 833.0, \"pending\": null, \"death\": 1.0, \"total\": 914, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 17.75, \"pos/100k\": 1.57, \"total/positive\": 11.28}, {\"state\": \"TX\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 194, \"negative\": 5083.0, \"pending\": null, \"death\": 5.0, \"total\": 5277, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 18.2, \"pos/100k\": 0.67, \"total/positive\": 27.2}, {\"state\": \"AR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 96, \"negative\": 351.0, \"pending\": 203.0, \"death\": null, \"total\": 650, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 21.54, \"pos/100k\": 3.18, \"total/positive\": 6.77}, {\"state\": \"IA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 45, \"negative\": 642.0, \"pending\": null, \"death\": null, \"total\": 687, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 21.77, \"pos/100k\": 1.43, \"total/positive\": 15.27}, {\"state\": \"PA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 268, \"negative\": 2574.0, \"pending\": null, \"death\": 1.0, \"total\": 2842, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.2, \"pos/100k\": 2.09, \"total/positive\": 10.6}, {\"state\": \"CT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 194, \"negative\": 604.0, \"pending\": null, \"death\": 3.0, \"total\": 798, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.38, \"pos/100k\": 5.44, \"total/positive\": 4.11}, {\"state\": \"GA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 420, \"negative\": 1966.0, \"pending\": null, \"death\": 13.0, \"total\": 2386, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.47, \"pos/100k\": 3.96, \"total/positive\": 5.68}, {\"state\": \"LA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 479, \"negative\": 568.0, \"pending\": null, \"death\": 12.0, \"total\": 1047, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.52, \"pos/100k\": 10.3, \"total/positive\": 2.19}, {\"state\": \"OK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 49, \"negative\": 538.0, \"pending\": 374.0, \"death\": 1.0, \"total\": 961, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 24.29, \"pos/100k\": 1.24, \"total/positive\": 19.61}, {\"state\": \"MS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 80, \"negative\": 695.0, \"pending\": null, \"death\": 1.0, \"total\": 775, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 26.04, \"pos/100k\": 2.69, \"total/positive\": 9.69}, {\"state\": \"MI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 549, \"negative\": 2069.0, \"pending\": null, \"death\": 3.0, \"total\": 2618, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 26.21, \"pos/100k\": 5.5, \"total/positive\": 4.77}, {\"state\": \"VA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 114, \"negative\": 2211.0, \"pending\": null, \"death\": 2.0, \"total\": 2325, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 27.24, \"pos/100k\": 1.34, \"total/positive\": 20.39}, {\"state\": \"CA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1063, \"negative\": 10424.0, \"pending\": null, \"death\": 20.0, \"total\": 11487, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 29.07, \"pos/100k\": 2.69, \"total/positive\": 10.81}, {\"state\": \"NC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 137, \"negative\": 3096.0, \"pending\": null, \"death\": 0.0, \"total\": 3233, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 30.83, \"pos/100k\": 1.31, \"total/positive\": 23.6}, {\"state\": \"IL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 590, \"negative\": 3696.0, \"pending\": null, \"death\": 5.0, \"total\": 4286, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 33.82, \"pos/100k\": 4.66, \"total/positive\": 7.26}, {\"state\": \"ID\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 23, \"negative\": 590.0, \"pending\": null, \"death\": null, \"total\": 613, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 34.21, \"pos/100k\": 1.28, \"total/positive\": 26.65}, {\"state\": \"CO\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 277, \"negative\": 2675.0, \"pending\": null, \"death\": 3.0, \"total\": 2952, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 51.26, \"pos/100k\": 4.81, \"total/positive\": 10.66}, {\"state\": \"MA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 413, \"negative\": 3678.0, \"pending\": null, \"death\": 1.0, \"total\": 4091, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 58.87, \"pos/100k\": 5.94, \"total/positive\": 9.91}, {\"state\": \"OR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 114, \"negative\": 2003.0, \"pending\": 433.0, \"death\": 3.0, \"total\": 2550, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 60.46, \"pos/100k\": 2.7, \"total/positive\": 22.37}, {\"state\": \"WY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 19, \"negative\": 331.0, \"pending\": null, \"death\": null, \"total\": 350, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 60.47, \"pos/100k\": 3.28, \"total/positive\": 18.42}, {\"state\": \"WI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 206, \"negative\": 3455.0, \"pending\": null, \"death\": 3.0, \"total\": 3661, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 62.88, \"pos/100k\": 3.54, \"total/positive\": 17.77}, {\"state\": \"UT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 112, \"negative\": 2035.0, \"pending\": null, \"death\": 0.0, \"total\": 2147, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 66.97, \"pos/100k\": 3.49, \"total/positive\": 19.17}, {\"state\": \"NV\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 109, \"negative\": 1992.0, \"pending\": -3.0, \"death\": 1.0, \"total\": 2098, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 68.11, \"pos/100k\": 3.54, \"total/positive\": 19.25}, {\"state\": \"MN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 115, \"negative\": 3741.0, \"pending\": null, \"death\": null, \"total\": 3856, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 68.37, \"pos/100k\": 2.04, \"total/positive\": 33.53}, {\"state\": \"RI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 54, \"negative\": 654.0, \"pending\": 140.0, \"death\": null, \"total\": 848, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 80.05, \"pos/100k\": 5.1, \"total/positive\": 15.7}, {\"state\": \"DC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 71, \"negative\": 501.0, \"pending\": 1.0, \"death\": 1.0, \"total\": 573, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 81.19, \"pos/100k\": 10.06, \"total/positive\": 8.07}, {\"state\": \"MT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 16, \"negative\": 931.0, \"pending\": null, \"death\": null, \"total\": 947, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 88.61, \"pos/100k\": 1.5, \"total/positive\": 59.19}, {\"state\": \"AK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 12, \"negative\": 686.0, \"pending\": null, \"death\": null, \"total\": 698, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 95.41, \"pos/100k\": 1.64, \"total/positive\": 58.17}, {\"state\": \"NH\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 44, \"negative\": 745.0, \"pending\": 631.0, \"death\": null, \"total\": 1420, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 104.43, \"pos/100k\": 3.24, \"total/positive\": 32.27}, {\"state\": \"SD\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 663.0, \"pending\": 270.0, \"death\": 1.0, \"total\": 947, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 107.05, \"pos/100k\": 1.58, \"total/positive\": 67.64}, {\"state\": \"ND\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 20, \"negative\": 800.0, \"pending\": null, \"death\": 0.0, \"total\": 820, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 107.6, \"pos/100k\": 2.62, \"total/positive\": 41.0}, {\"state\": \"VT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 29, \"negative\": 779.0, \"pending\": null, \"death\": 2.0, \"total\": 808, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 129.49, \"pos/100k\": 4.65, \"total/positive\": 27.86}, {\"state\": \"NY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7102, \"negative\": 25325.0, \"pending\": null, \"death\": 35.0, \"total\": 32427, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 166.69, \"pos/100k\": 36.51, \"total/positive\": 4.57}, {\"state\": \"ME\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 57, \"negative\": 2264.0, \"pending\": null, \"death\": null, \"total\": 2321, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 172.67, \"pos/100k\": 4.24, \"total/positive\": 40.72}, {\"state\": \"NM\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 43, \"negative\": 3771.0, \"pending\": null, \"death\": null, \"total\": 3814, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 181.89, \"pos/100k\": 2.05, \"total/positive\": 88.7}, {\"state\": \"WA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1376, \"negative\": 19336.0, \"pending\": null, \"death\": 74.0, \"total\": 20712, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 271.99, \"pos/100k\": 18.07, \"total/positive\": 15.05}]}}, {\"mode\": \"vega-lite\"});\n", "</script>" ], "text/plain": [ "alt.LayerChart(...)" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#resort dataframe in ascending order of testing rates per 100k population\n", "source_df = most_recent_df.sort_values('tests/100k')\n", "\n", "#drop data points without total testing info\n", "source_df =source_df.dropna(subset=['tests/100k'])\n", "\n", "#now create some layers for the chart\n", "base = alt.Chart(source_df,\n", " title='COVID-19 in the States : tests and positive cases / 100k Population').encode(\n", " alt.X('state',sort='x'))\n", " \n", "bar = base.mark_bar(color='lightgrey').encode(\n", " alt.X('state',sort='x'),\n", " alt.Y('tests/100k',axis=alt.Axis(title='Tests / 100k population',grid=True)),\n", " tooltip=['state','pos/100k','tests/100k','positive']\n", ")\n", "\n", "#positive cases as absolute number\n", "circle = base.mark_circle(color='blue',size=60).encode(\n", " alt.X('state',sort='x'),\n", " alt.Y('positive', axis=alt.Axis(title='Positive COVID-19 Cases')),\n", " tooltip=['state','positive','tests/100k']\n", ")\n", "\n", "#postives per 100,000 pop\n", "circle2 = base.mark_circle(color='blue',size=60).encode(\n", " alt.X('state',sort='x'),\n", " alt.Y('pos/100k', axis=alt.Axis(title='Positive COVID-19 Cases/100k population',tickMinStep=5)),\n", " tooltip=['state','pos/100k','tests/100k','positive']\n", ")\n", "\n", "#assemble the chart with two independent y-axes\n", "bigChart = alt.layer(bar,circle2).resolve_scale(y='independent').properties(width=800,height=600)\n", "bigChart" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>state</th>\n", " <th>date</th>\n", " <th>positive</th>\n", " <th>negative</th>\n", " <th>pending</th>\n", " <th>death</th>\n", " <th>total</th>\n", " <th>dateChecked</th>\n", " <th>tests/100k</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>8</th>\n", " <td>DC</td>\n", " <td>2020-03-19</td>\n", " <td>39</td>\n", " <td>153.0</td>\n", " <td>11.0</td>\n", " <td>0.0</td>\n", " <td>203</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>28.76</td>\n", " </tr>\n", " <tr>\n", " <th>53</th>\n", " <td>WI</td>\n", " <td>2020-03-19</td>\n", " <td>155</td>\n", " <td>2192.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>2347</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>40.31</td>\n", " </tr>\n", " <tr>\n", " <th>6</th>\n", " <td>CO</td>\n", " <td>2020-03-19</td>\n", " <td>216</td>\n", " <td>2112.0</td>\n", " <td>NaN</td>\n", " <td>2.0</td>\n", " <td>2328</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>40.43</td>\n", " </tr>\n", " <tr>\n", " <th>40</th>\n", " <td>OR</td>\n", " <td>2020-03-19</td>\n", " <td>88</td>\n", " <td>1329.0</td>\n", " <td>437.0</td>\n", " <td>3.0</td>\n", " <td>1854</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>43.96</td>\n", " </tr>\n", " <tr>\n", " <th>21</th>\n", " <td>MA</td>\n", " <td>2020-03-19</td>\n", " <td>328</td>\n", " <td>2804.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>3132</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>45.07</td>\n", " </tr>\n", " <tr>\n", " <th>55</th>\n", " <td>WY</td>\n", " <td>2020-03-19</td>\n", " <td>18</td>\n", " <td>271.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>289</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>49.93</td>\n", " </tr>\n", " <tr>\n", " <th>48</th>\n", " <td>UT</td>\n", " <td>2020-03-19</td>\n", " <td>78</td>\n", " <td>1526.0</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>1604</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>50.03</td>\n", " </tr>\n", " <tr>\n", " <th>25</th>\n", " <td>MN</td>\n", " <td>2020-03-19</td>\n", " <td>89</td>\n", " <td>2949.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>3038</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>53.87</td>\n", " </tr>\n", " <tr>\n", " <th>0</th>\n", " <td>AK</td>\n", " <td>2020-03-19</td>\n", " <td>6</td>\n", " <td>400.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>406</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>55.50</td>\n", " </tr>\n", " <tr>\n", " <th>36</th>\n", " <td>NV</td>\n", " <td>2020-03-19</td>\n", " <td>95</td>\n", " <td>1626.0</td>\n", " <td>NaN</td>\n", " <td>1.0</td>\n", " <td>1721</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>55.87</td>\n", " </tr>\n", " <tr>\n", " <th>33</th>\n", " <td>NH</td>\n", " <td>2020-03-19</td>\n", " <td>39</td>\n", " <td>621.0</td>\n", " <td>231.0</td>\n", " <td>NaN</td>\n", " <td>891</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>65.53</td>\n", " </tr>\n", " <tr>\n", " <th>31</th>\n", " <td>ND</td>\n", " <td>2020-03-19</td>\n", " <td>15</td>\n", " <td>493.0</td>\n", " <td>NaN</td>\n", " <td>0.0</td>\n", " <td>508</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>66.66</td>\n", " </tr>\n", " <tr>\n", " <th>29</th>\n", " <td>MT</td>\n", " <td>2020-03-19</td>\n", " <td>12</td>\n", " <td>761.0</td>\n", " <td>0.0</td>\n", " <td>NaN</td>\n", " <td>773</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>72.33</td>\n", " </tr>\n", " <tr>\n", " <th>43</th>\n", " <td>RI</td>\n", " <td>2020-03-19</td>\n", " <td>33</td>\n", " <td>540.0</td>\n", " <td>334.0</td>\n", " <td>NaN</td>\n", " <td>907</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>85.62</td>\n", " </tr>\n", " <tr>\n", " <th>51</th>\n", " <td>VT</td>\n", " <td>2020-03-19</td>\n", " <td>22</td>\n", " <td>645.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>667</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>106.89</td>\n", " </tr>\n", " <tr>\n", " <th>45</th>\n", " <td>SD</td>\n", " <td>2020-03-19</td>\n", " <td>11</td>\n", " <td>551.0</td>\n", " <td>385.0</td>\n", " <td>1.0</td>\n", " <td>947</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>107.05</td>\n", " </tr>\n", " <tr>\n", " <th>37</th>\n", " <td>NY</td>\n", " <td>2020-03-19</td>\n", " <td>4152</td>\n", " <td>18132.0</td>\n", " <td>NaN</td>\n", " <td>12.0</td>\n", " <td>22284</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>114.55</td>\n", " </tr>\n", " <tr>\n", " <th>35</th>\n", " <td>NM</td>\n", " <td>2020-03-19</td>\n", " <td>35</td>\n", " <td>2762.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>2797</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>133.39</td>\n", " </tr>\n", " <tr>\n", " <th>23</th>\n", " <td>ME</td>\n", " <td>2020-03-19</td>\n", " <td>53</td>\n", " <td>2004.0</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>2057</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>153.03</td>\n", " </tr>\n", " <tr>\n", " <th>52</th>\n", " <td>WA</td>\n", " <td>2020-03-19</td>\n", " <td>1187</td>\n", " <td>15918.0</td>\n", " <td>NaN</td>\n", " <td>66.0</td>\n", " <td>17105</td>\n", " <td>2020-03-19T20:00:00Z</td>\n", " <td>224.63</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " state date positive negative pending death total \\\n", "8 DC 2020-03-19 39 153.0 11.0 0.0 203 \n", "53 WI 2020-03-19 155 2192.0 NaN NaN 2347 \n", "6 CO 2020-03-19 216 2112.0 NaN 2.0 2328 \n", "40 OR 2020-03-19 88 1329.0 437.0 3.0 1854 \n", "21 MA 2020-03-19 328 2804.0 NaN NaN 3132 \n", "55 WY 2020-03-19 18 271.0 NaN NaN 289 \n", "48 UT 2020-03-19 78 1526.0 NaN 0.0 1604 \n", "25 MN 2020-03-19 89 2949.0 NaN NaN 3038 \n", "0 AK 2020-03-19 6 400.0 NaN NaN 406 \n", "36 NV 2020-03-19 95 1626.0 NaN 1.0 1721 \n", "33 NH 2020-03-19 39 621.0 231.0 NaN 891 \n", "31 ND 2020-03-19 15 493.0 NaN 0.0 508 \n", "29 MT 2020-03-19 12 761.0 0.0 NaN 773 \n", "43 RI 2020-03-19 33 540.0 334.0 NaN 907 \n", "51 VT 2020-03-19 22 645.0 NaN NaN 667 \n", "45 SD 2020-03-19 11 551.0 385.0 1.0 947 \n", "37 NY 2020-03-19 4152 18132.0 NaN 12.0 22284 \n", "35 NM 2020-03-19 35 2762.0 NaN NaN 2797 \n", "23 ME 2020-03-19 53 2004.0 NaN NaN 2057 \n", "52 WA 2020-03-19 1187 15918.0 NaN 66.0 17105 \n", "\n", " dateChecked tests/100k \n", "8 2020-03-19T20:00:00Z 28.76 \n", "53 2020-03-19T20:00:00Z 40.31 \n", "6 2020-03-19T20:00:00Z 40.43 \n", "40 2020-03-19T20:00:00Z 43.96 \n", "21 2020-03-19T20:00:00Z 45.07 \n", "55 2020-03-19T20:00:00Z 49.93 \n", "48 2020-03-19T20:00:00Z 50.03 \n", "25 2020-03-19T20:00:00Z 53.87 \n", "0 2020-03-19T20:00:00Z 55.50 \n", "36 2020-03-19T20:00:00Z 55.87 \n", "33 2020-03-19T20:00:00Z 65.53 \n", "31 2020-03-19T20:00:00Z 66.66 \n", "29 2020-03-19T20:00:00Z 72.33 \n", "43 2020-03-19T20:00:00Z 85.62 \n", "51 2020-03-19T20:00:00Z 106.89 \n", "45 2020-03-19T20:00:00Z 107.05 \n", "37 2020-03-19T20:00:00Z 114.55 \n", "35 2020-03-19T20:00:00Z 133.39 \n", "23 2020-03-19T20:00:00Z 153.03 \n", "52 2020-03-19T20:00:00Z 224.63 " ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source_df.tail(20)\n" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "# Cases per 100,000 population" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "#Load most recent data and city population counts\n", "data_df = pd.read_json('../../data/covidtracking/states-daily.json')\n", "data_df['date'] = pd.to_datetime(data_df['date'], format=\"%Y%m%d\")\n", "pop_df = pd.read_csv('../../data/geodata/us_pop_fung_2019.csv').set_index('ST')\n" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Most recent test date 2020-03-19 00:00:00\n", "56 states/territories have data on this date.\n" ] } ], "source": [ "most_recent_test_date = data_df['date'].max()\n", "most_recent_df = data_df[data_df['date'] == most_recent_test_date].set_index('state')\n", "print(\"Most recent test date\", most_recent_test_date)\n", "print(len(most_recent_df), \"states/territories have data on this date.\")" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "#add state populations to dataframe\n", "most_recent_df['population'] = pop_df['Population']\n", "most_recent_df = most_recent_df.reset_index()" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "<div id=\"altair-viz-f4a22cbdc834409298c786b80d952eb3\"></div>\n", "<script type=\"text/javascript\">\n", " (function(spec, embedOpt){\n", " const outputDiv = document.getElementById(\"altair-viz-f4a22cbdc834409298c786b80d952eb3\");\n", " const paths = {\n", " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n", " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", " };\n", "\n", " function loadScript(lib) {\n", " return new Promise(function(resolve, reject) {\n", " var s = document.createElement('script');\n", " s.src = paths[lib];\n", " s.async = true;\n", " s.onload = () => resolve(paths[lib]);\n", " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " });\n", " }\n", "\n", " function showError(err) {\n", " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", " throw err;\n", " }\n", "\n", " function displayChart(vegaEmbed) {\n", " vegaEmbed(outputDiv, spec, embedOpt)\n", " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", " }\n", "\n", " if(typeof define === \"function\" && define.amd) {\n", " requirejs.config({paths});\n", " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", " } else if (typeof vegaEmbed === \"function\") {\n", " displayChart(vegaEmbed);\n", " } else {\n", " loadScript(\"vega\")\n", " .then(() => loadScript(\"vega-lite\"))\n", " .then(() => loadScript(\"vega-embed\"))\n", " .catch(showError)\n", " .then(() => displayChart(vegaEmbed));\n", " }\n", " })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"mark\": {\"type\": \"circle\", \"size\": 80}, \"encoding\": {\"tooltip\": [{\"type\": \"nominal\", \"field\": \"state\"}, {\"type\": \"quantitative\", \"field\": \"population\"}, {\"type\": \"quantitative\", \"field\": \"positive\"}, {\"type\": \"quantitative\", \"field\": \"total\"}], \"x\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"State Population\"}, \"field\": \"population\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"COVID-19 Positive Individuals\"}, \"field\": \"positive\"}}, \"height\": 600, \"selection\": {\"selector002\": {\"type\": \"interval\", \"bind\": \"scales\", \"encodings\": [\"x\", \"y\"]}}, \"title\": \"Postive Cases vs. Population by US State\", \"width\": 800}, {\"mark\": \"line\", \"encoding\": {\"tooltip\": [{\"type\": \"nominal\", \"field\": \"state\"}, {\"type\": \"quantitative\", \"field\": \"population\"}, {\"type\": \"quantitative\", \"field\": \"positive\"}, {\"type\": \"quantitative\", \"field\": \"total\"}], \"x\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"State Population\"}, \"field\": \"population\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"COVID-19 Positive Individuals\"}, \"field\": \"positive\"}}, \"height\": 600, \"title\": \"Postive Cases vs. Population by US State\", \"transform\": [{\"on\": \"population\", \"regression\": \"positive\"}], \"width\": 800}], \"data\": {\"name\": \"data-4d7a412013688399019d1dbecb395523\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-4d7a412013688399019d1dbecb395523\": [{\"state\": \"AK\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 6, \"negative\": 400.0, \"pending\": null, \"death\": null, \"total\": 406, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 731545.0}, {\"state\": \"AL\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 68, \"negative\": 28.0, \"pending\": null, \"death\": 0.0, \"total\": 96, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 4903185.0}, {\"state\": \"AR\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 46, \"negative\": 310.0, \"pending\": 113.0, \"death\": null, \"total\": 469, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 3017825.0}, {\"state\": \"AS\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": null}, {\"state\": \"AZ\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 44, \"negative\": 175.0, \"pending\": 130.0, \"death\": 0.0, \"total\": 349, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 7278717.0}, {\"state\": \"CA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 924, \"negative\": 8787.0, \"pending\": null, \"death\": 18.0, \"total\": 9711, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 39512223.0}, {\"state\": \"CO\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 216, \"negative\": 2112.0, \"pending\": null, \"death\": 2.0, \"total\": 2328, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 5758736.0}, {\"state\": \"CT\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 96, \"negative\": 604.0, \"pending\": null, \"death\": 1.0, \"total\": 700, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 3565287.0}, {\"state\": \"DC\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 39, \"negative\": 153.0, \"pending\": 11.0, \"death\": 0.0, \"total\": 203, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 705749.0}, {\"state\": \"DE\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 30, \"negative\": 36.0, \"pending\": null, \"death\": 0.0, \"total\": 66, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 973764.0}, {\"state\": \"FL\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 390, \"negative\": 1533.0, \"pending\": 1019.0, \"death\": 8.0, \"total\": 2942, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 21477737.0}, {\"state\": \"GA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 287, \"negative\": 1544.0, \"pending\": null, \"death\": 10.0, \"total\": 1831, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 10617423.0}, {\"state\": \"GU\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 12, \"negative\": 69.0, \"pending\": null, \"death\": null, \"total\": 81, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": null}, {\"state\": \"HI\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 16, \"negative\": 93.0, \"pending\": 9.0, \"death\": null, \"total\": 118, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1415872.0}, {\"state\": \"IA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 38, \"negative\": 83.0, \"pending\": null, \"death\": null, \"total\": 121, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 3155070.0}, {\"state\": \"ID\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 11, \"negative\": 457.0, \"pending\": null, \"death\": null, \"total\": 468, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1792065.0}, {\"state\": \"IL\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 426, \"negative\": 2725.0, \"pending\": null, \"death\": 4.0, \"total\": 3151, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 12671821.0}, {\"state\": \"IN\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 56, \"negative\": 324.0, \"pending\": null, \"death\": 2.0, \"total\": 380, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 6732219.0}, {\"state\": \"KS\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 34, \"negative\": 417.0, \"pending\": null, \"death\": 1.0, \"total\": 451, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 2913314.0}, {\"state\": \"KY\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 35, \"negative\": 454.0, \"pending\": null, \"death\": 1.0, \"total\": 489, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 4467673.0}, {\"state\": \"LA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 347, \"negative\": 458.0, \"pending\": null, \"death\": 8.0, \"total\": 805, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 4648794.0}, {\"state\": \"MA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 328, \"negative\": 2804.0, \"pending\": null, \"death\": null, \"total\": 3132, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 6949503.0}, {\"state\": \"MD\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 107, \"negative\": 94.0, \"pending\": null, \"death\": 1.0, \"total\": 201, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 6045680.0}, {\"state\": \"ME\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 53, \"negative\": 2004.0, \"pending\": null, \"death\": null, \"total\": 2057, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1344212.0}, {\"state\": \"MI\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 336, \"negative\": 2113.0, \"pending\": null, \"death\": 3.0, \"total\": 2449, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 9986857.0}, {\"state\": \"MN\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 89, \"negative\": 2949.0, \"pending\": null, \"death\": null, \"total\": 3038, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 5639632.0}, {\"state\": \"MO\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 24, \"negative\": 308.0, \"pending\": null, \"death\": 1.0, \"total\": 332, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 6137428.0}, {\"state\": \"MP\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": null}, {\"state\": \"MS\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 50, \"negative\": 552.0, \"pending\": null, \"death\": null, \"total\": 602, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 2976149.0}, {\"state\": \"MT\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 12, \"negative\": 761.0, \"pending\": 0.0, \"death\": null, \"total\": 773, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1068778.0}, {\"state\": \"NC\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 97, \"negative\": 2408.0, \"pending\": null, \"death\": 0.0, \"total\": 2505, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 10488084.0}, {\"state\": \"ND\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 15, \"negative\": 493.0, \"pending\": null, \"death\": 0.0, \"total\": 508, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 762062.0}, {\"state\": \"NE\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 27, \"negative\": 240.0, \"pending\": null, \"death\": 0.0, \"total\": 267, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1934408.0}, {\"state\": \"NH\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 39, \"negative\": 621.0, \"pending\": 231.0, \"death\": null, \"total\": 891, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1359711.0}, {\"state\": \"NJ\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 742, \"negative\": 210.0, \"pending\": 74.0, \"death\": 9.0, \"total\": 1026, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 8882190.0}, {\"state\": \"NM\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 35, \"negative\": 2762.0, \"pending\": null, \"death\": null, \"total\": 2797, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 2096829.0}, {\"state\": \"NV\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 95, \"negative\": 1626.0, \"pending\": null, \"death\": 1.0, \"total\": 1721, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 3080156.0}, {\"state\": \"NY\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 4152, \"negative\": 18132.0, \"pending\": null, \"death\": 12.0, \"total\": 22284, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 19453561.0}, {\"state\": \"OH\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 119, \"negative\": 140.0, \"pending\": null, \"death\": null, \"total\": 259, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 11689100.0}, {\"state\": \"OK\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 44, \"negative\": 466.0, \"pending\": 250.0, \"death\": 1.0, \"total\": 760, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 3956971.0}, {\"state\": \"OR\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 88, \"negative\": 1329.0, \"pending\": 437.0, \"death\": 3.0, \"total\": 1854, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 4217737.0}, {\"state\": \"PA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 185, \"negative\": 1608.0, \"pending\": null, \"death\": 1.0, \"total\": 1793, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 12801989.0}, {\"state\": \"PR\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 5, \"negative\": 56.0, \"pending\": 29.0, \"death\": null, \"total\": 90, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": null}, {\"state\": \"RI\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 33, \"negative\": 540.0, \"pending\": 334.0, \"death\": null, \"total\": 907, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1059361.0}, {\"state\": \"SC\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 60, \"negative\": 583.0, \"pending\": null, \"death\": 1.0, \"total\": 643, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 5148714.0}, {\"state\": \"SD\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 11, \"negative\": 551.0, \"pending\": 385.0, \"death\": 1.0, \"total\": 947, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 884659.0}, {\"state\": \"TN\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 154, \"negative\": 349.0, \"pending\": null, \"death\": null, \"total\": 503, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 6833174.0}, {\"state\": \"TX\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 143, \"negative\": 2212.0, \"pending\": null, \"death\": 3.0, \"total\": 2355, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 28995881.0}, {\"state\": \"UT\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 78, \"negative\": 1526.0, \"pending\": null, \"death\": 0.0, \"total\": 1604, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 3205958.0}, {\"state\": \"VA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 94, \"negative\": 1829.0, \"pending\": null, \"death\": 2.0, \"total\": 1923, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 8535519.0}, {\"state\": \"VI\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 3, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 3, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": null}, {\"state\": \"VT\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 22, \"negative\": 645.0, \"pending\": null, \"death\": null, \"total\": 667, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 623989.0}, {\"state\": \"WA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 1187, \"negative\": 15918.0, \"pending\": null, \"death\": 66.0, \"total\": 17105, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 7614893.0}, {\"state\": \"WI\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 155, \"negative\": 2192.0, \"pending\": null, \"death\": null, \"total\": 2347, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 5822434.0}, {\"state\": \"WV\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 2, \"negative\": 143.0, \"pending\": 3.0, \"death\": 0.0, \"total\": 148, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 1787147.0}, {\"state\": \"WY\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 18, \"negative\": 271.0, \"pending\": null, \"death\": null, \"total\": 289, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"population\": 578759.0}]}}, {\"mode\": \"vega-lite\"});\n", "</script>" ], "text/plain": [ "alt.LayerChart(...)" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "popChart = alt.Chart(most_recent_df, title='Postive Cases vs. Population by US State').mark_circle(size=80).encode(\n", " alt.X('population',axis=alt.Axis(title='State Population')),\n", " alt.Y('positive', axis=alt.Axis(title='COVID-19 Positive Individuals')),\n", " tooltip=['state','population','positive','total']\n", ").properties(width=800, height=600)\n", "\n", "popChart = popChart + popChart.transform_regression('population','positive').mark_line()\n", "\n", "popChart.interactive()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Cases by State in Order of Number" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "<div id=\"altair-viz-3188332fe9a24884b4e76b5f4e2c6237\"></div>\n", "<script type=\"text/javascript\">\n", " (function(spec, embedOpt){\n", " const outputDiv = document.getElementById(\"altair-viz-3188332fe9a24884b4e76b5f4e2c6237\");\n", " const paths = {\n", " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.0.2?noext\",\n", " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", " };\n", "\n", " function loadScript(lib) {\n", " return new Promise(function(resolve, reject) {\n", " var s = document.createElement('script');\n", " s.src = paths[lib];\n", " s.async = true;\n", " s.onload = () => resolve(paths[lib]);\n", " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " });\n", " }\n", "\n", " function showError(err) {\n", " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", " throw err;\n", " }\n", "\n", " function displayChart(vegaEmbed) {\n", " vegaEmbed(outputDiv, spec, embedOpt)\n", " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", " }\n", "\n", " if(typeof define === \"function\" && define.amd) {\n", " requirejs.config({paths});\n", " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", " } else if (typeof vegaEmbed === \"function\") {\n", " displayChart(vegaEmbed);\n", " } else {\n", " loadScript(\"vega\")\n", " .then(() => loadScript(\"vega-lite\"))\n", " .then(() => loadScript(\"vega-embed\"))\n", " .catch(showError)\n", " .then(() => displayChart(vegaEmbed));\n", " }\n", " })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-1c4c9f5adf13667e4ca74e079c39c17d\"}, \"mark\": \"bar\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"state\", \"sort\": \"y\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"total/positive\"}}, \"height\": 600, \"title\": \"Tests per Positve Case\", \"width\": 800, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-1c4c9f5adf13667e4ca74e079c39c17d\": [{\"state\": \"VI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 3, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 3, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": null, \"total/positive\": 1.0}, {\"state\": \"AL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 81, \"negative\": 28.0, \"pending\": null, \"death\": 0.0, \"total\": 109, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 2.22, \"total/positive\": 1.35}, {\"state\": \"NJ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 890, \"negative\": 264.0, \"pending\": 86.0, \"death\": 11.0, \"total\": 1240, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 13.96, \"total/positive\": 1.39}, {\"state\": \"MD\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 149, \"negative\": 94.0, \"pending\": null, \"death\": 1.0, \"total\": 243, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 4.02, \"total/positive\": 1.63}, {\"state\": \"OH\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 169, \"negative\": 140.0, \"pending\": null, \"death\": 1.0, \"total\": 309, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 2.64, \"total/positive\": 1.83}, {\"state\": \"DE\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 38, \"negative\": 36.0, \"pending\": null, \"death\": 0.0, \"total\": 74, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 7.6, \"total/positive\": 1.95}, {\"state\": \"LA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 479, \"negative\": 568.0, \"pending\": null, \"death\": 12.0, \"total\": 1047, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.52, \"total/positive\": 2.19}, {\"state\": \"TN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 228, \"negative\": 563.0, \"pending\": null, \"death\": null, \"total\": 791, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 11.58, \"total/positive\": 3.47}, {\"state\": \"CT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 194, \"negative\": 604.0, \"pending\": null, \"death\": 3.0, \"total\": 798, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.38, \"total/positive\": 4.11}, {\"state\": \"NY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7102, \"negative\": 25325.0, \"pending\": null, \"death\": 35.0, \"total\": 32427, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 166.69, \"total/positive\": 4.57}, {\"state\": \"MI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 549, \"negative\": 2069.0, \"pending\": null, \"death\": 3.0, \"total\": 2618, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 26.21, \"total/positive\": 4.77}, {\"state\": \"GA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 420, \"negative\": 1966.0, \"pending\": null, \"death\": 13.0, \"total\": 2386, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.47, \"total/positive\": 5.68}, {\"state\": \"AZ\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 65, \"negative\": 211.0, \"pending\": 101.0, \"death\": 0.0, \"total\": 377, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 5.18, \"total/positive\": 5.8}, {\"state\": \"HI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 26, \"negative\": 124.0, \"pending\": 9.0, \"death\": null, \"total\": 159, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 11.23, \"total/positive\": 6.12}, {\"state\": \"FL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 520, \"negative\": 1870.0, \"pending\": 1026.0, \"death\": 10.0, \"total\": 3416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 15.9, \"total/positive\": 6.57}, {\"state\": \"AR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 96, \"negative\": 351.0, \"pending\": 203.0, \"death\": null, \"total\": 650, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 21.54, \"total/positive\": 6.77}, {\"state\": \"IN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 79, \"negative\": 475.0, \"pending\": null, \"death\": 2.0, \"total\": 554, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 8.23, \"total/positive\": 7.01}, {\"state\": \"GU\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 86.0, \"pending\": null, \"death\": null, \"total\": 100, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": null, \"total/positive\": 7.14}, {\"state\": \"IL\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 590, \"negative\": 3696.0, \"pending\": null, \"death\": 5.0, \"total\": 4286, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 33.82, \"total/positive\": 7.26}, {\"state\": \"DC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 71, \"negative\": 501.0, \"pending\": 1.0, \"death\": 1.0, \"total\": 573, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 81.19, \"total/positive\": 8.07}, {\"state\": \"NE\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 32, \"negative\": 240.0, \"pending\": null, \"death\": 0.0, \"total\": 272, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 14.06, \"total/positive\": 8.5}, {\"state\": \"MO\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 47, \"negative\": 369.0, \"pending\": null, \"death\": 1.0, \"total\": 416, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 6.78, \"total/positive\": 8.85}, {\"state\": \"MS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 80, \"negative\": 695.0, \"pending\": null, \"death\": 1.0, \"total\": 775, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 26.04, \"total/positive\": 9.69}, {\"state\": \"MA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 413, \"negative\": 3678.0, \"pending\": null, \"death\": 1.0, \"total\": 4091, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 58.87, \"total/positive\": 9.91}, {\"state\": \"KS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 44, \"negative\": 417.0, \"pending\": null, \"death\": 1.0, \"total\": 461, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 15.82, \"total/positive\": 10.48}, {\"state\": \"PA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 268, \"negative\": 2574.0, \"pending\": null, \"death\": 1.0, \"total\": 2842, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 22.2, \"total/positive\": 10.6}, {\"state\": \"CO\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 277, \"negative\": 2675.0, \"pending\": null, \"death\": 3.0, \"total\": 2952, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 51.26, \"total/positive\": 10.66}, {\"state\": \"CA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1063, \"negative\": 10424.0, \"pending\": null, \"death\": 20.0, \"total\": 11487, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 29.07, \"total/positive\": 10.81}, {\"state\": \"SC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 81, \"negative\": 833.0, \"pending\": null, \"death\": 1.0, \"total\": 914, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 17.75, \"total/positive\": 11.28}, {\"state\": \"PR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 114.0, \"pending\": 52.0, \"death\": null, \"total\": 180, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": null, \"total/positive\": 12.86}, {\"state\": \"KY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 47, \"negative\": 592.0, \"pending\": null, \"death\": 1.0, \"total\": 639, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 14.3, \"total/positive\": 13.6}, {\"state\": \"WA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1376, \"negative\": 19336.0, \"pending\": null, \"death\": 74.0, \"total\": 20712, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 271.99, \"total/positive\": 15.05}, {\"state\": \"IA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 45, \"negative\": 642.0, \"pending\": null, \"death\": null, \"total\": 687, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 21.77, \"total/positive\": 15.27}, {\"state\": \"RI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 54, \"negative\": 654.0, \"pending\": 140.0, \"death\": null, \"total\": 848, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 80.05, \"total/positive\": 15.7}, {\"state\": \"WI\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 206, \"negative\": 3455.0, \"pending\": null, \"death\": 3.0, \"total\": 3661, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 62.88, \"total/positive\": 17.77}, {\"state\": \"WY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 19, \"negative\": 331.0, \"pending\": null, \"death\": null, \"total\": 350, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 60.47, \"total/positive\": 18.42}, {\"state\": \"UT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 112, \"negative\": 2035.0, \"pending\": null, \"death\": 0.0, \"total\": 2147, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 66.97, \"total/positive\": 19.17}, {\"state\": \"NV\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 109, \"negative\": 1992.0, \"pending\": -3.0, \"death\": 1.0, \"total\": 2098, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 68.11, \"total/positive\": 19.25}, {\"state\": \"OK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 49, \"negative\": 538.0, \"pending\": 374.0, \"death\": 1.0, \"total\": 961, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 24.29, \"total/positive\": 19.61}, {\"state\": \"VA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 114, \"negative\": 2211.0, \"pending\": null, \"death\": 2.0, \"total\": 2325, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 27.24, \"total/positive\": 20.39}, {\"state\": \"OR\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 114, \"negative\": 2003.0, \"pending\": 433.0, \"death\": 3.0, \"total\": 2550, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 60.46, \"total/positive\": 22.37}, {\"state\": \"NC\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 137, \"negative\": 3096.0, \"pending\": null, \"death\": 0.0, \"total\": 3233, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 30.83, \"total/positive\": 23.6}, {\"state\": \"ID\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 23, \"negative\": 590.0, \"pending\": null, \"death\": null, \"total\": 613, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 34.21, \"total/positive\": 26.65}, {\"state\": \"TX\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 194, \"negative\": 5083.0, \"pending\": null, \"death\": 5.0, \"total\": 5277, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 18.2, \"total/positive\": 27.2}, {\"state\": \"VT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 29, \"negative\": 779.0, \"pending\": null, \"death\": 2.0, \"total\": 808, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 129.49, \"total/positive\": 27.86}, {\"state\": \"NH\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 44, \"negative\": 745.0, \"pending\": 631.0, \"death\": null, \"total\": 1420, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 104.43, \"total/positive\": 32.27}, {\"state\": \"MN\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 115, \"negative\": 3741.0, \"pending\": null, \"death\": null, \"total\": 3856, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 68.37, \"total/positive\": 33.53}, {\"state\": \"WV\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7, \"negative\": 219.0, \"pending\": 13.0, \"death\": 0.0, \"total\": 239, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 13.37, \"total/positive\": 34.14}, {\"state\": \"ME\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 57, \"negative\": 2264.0, \"pending\": null, \"death\": null, \"total\": 2321, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 172.67, \"total/positive\": 40.72}, {\"state\": \"ND\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 20, \"negative\": 800.0, \"pending\": null, \"death\": 0.0, \"total\": 820, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 107.6, \"total/positive\": 41.0}, {\"state\": \"AK\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 12, \"negative\": 686.0, \"pending\": null, \"death\": null, \"total\": 698, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 95.41, \"total/positive\": 58.17}, {\"state\": \"MT\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 16, \"negative\": 931.0, \"pending\": null, \"death\": null, \"total\": 947, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 88.61, \"total/positive\": 59.19}, {\"state\": \"SD\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 14, \"negative\": 663.0, \"pending\": 270.0, \"death\": 1.0, \"total\": 947, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 107.05, \"total/positive\": 67.64}, {\"state\": \"NM\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 43, \"negative\": 3771.0, \"pending\": null, \"death\": null, \"total\": 3814, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": 181.89, \"total/positive\": 88.7}, {\"state\": \"AS\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": null, \"total/positive\": null}, {\"state\": \"MP\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 0, \"negative\": null, \"pending\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"tests/100k\": null, \"total/positive\": null}]}}, {\"mode\": \"vega-lite\"});\n", "</script>" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chart = alt.Chart(most_recent_df.sort_values('total/positive'), title=\"Tests per Positve Case\")\n", "chart.mark_bar().encode(alt.X('state', sort='y'), alt.Y('total/positive')).properties (width=800,height=600)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 4 }