Newer
Older
{
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import altair as alt\n",
"from IPython.display import display, HTML"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"html_credits=HTML('''\n",
"<p style=\"font-size: smaller\">Data Sources: \n",
" <a href=\"https://covidtracking.com\">The COVID Tracking Project</a>\n",
"<br>\n",
"Analysis and Visualization:\n",
" <a href=\"https://renkulab.io/projects/covid-19/covid-19-public-data\">Covid-19 Public Data Collaboration Project</a>\n",
"</p>''')"
]
},
{
"cell_type": "code",
"execution_count": 10,
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"metadata": {},
"outputs": [],
"source": [
"# Read population data\n",
"pop_df = pd.read_csv('../data/geodata/us_pop_fung_2019.csv').set_index('ST')\n",
"\n",
"# Read state-level data\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",
"data_df['ratio'] = data_df['positive']/data_df['total']\n",
"\n",
"# 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",
"# incidence rates\n",
"tdf_diff = tdf_diff.set_index('state')\n",
"tdf_diff['positive_diff_100k'] = (tdf_diff['positive_diff'] / pop_df['Population']) * 100000\n",
"tdf_diff['death_diff_100k'] = (tdf_diff['death_diff'] / pop_df['Population']) * 100000\n",
"tdf_diff = tdf_diff.reset_index()\n",
"\n",
"# \"Normalizing\" the totals\n",
"tdf_diff['total_10'] = tdf_diff['total']/10.\n",
"\n",
"# Daily totals\n",
"daily_totals = tdf_diff.groupby('date').sum()\n",
"daily_totals.reset_index(level=0, inplace=True)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Covid-19 Cases in U.S.\n",
"\n",
"The case data from the U.S. is obtained from https://covidtracking.com, a public crowd-sourced covid-19 dataset. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Daily Cumulative Totals\n",
"\n",
"Cumulative reported totals of positive cases and deaths. "
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div id=\"altair-viz-8faa4cdbb71041ba91d24efbf1012dad\"></div>\n",
"<script type=\"text/javascript\">\n",
" (function(spec, embedOpt){\n",
" const outputDiv = document.getElementById(\"altair-viz-8faa4cdbb71041ba91d24efbf1012dad\");\n",
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
" 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}, \"title\": {\"anchor\": \"middle\"}}, \"vconcat\": [{\"hconcat\": [{\"mark\": {\"type\": \"bar\", \"size\": 15}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"positive\", \"title\": \"Cumulative cases\"}}}, {\"mark\": {\"type\": \"bar\", \"size\": 15}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"positive_diff\", \"title\": \"Daily cases\"}}}]}, {\"hconcat\": [{\"mark\": {\"type\": \"bar\", \"size\": 15}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"death\", \"title\": \"Cumulative deaths\"}}}, {\"mark\": {\"type\": \"bar\", \"size\": 15}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"field\": \"death_diff\", \"title\": \"Daily deaths\"}}}]}], \"data\": {\"name\": \"data-1c0bc566dfc680c328e00f82da41d5b8\"}, \"title\": \"Cumulative Covid-19 cases in the U.S.\", \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-1c0bc566dfc680c328e00f82da41d5b8\": [{\"date\": \"2020-03-04T00:00:00\", \"positive\": 118.0, \"negative\": 748.0, \"pending\": 103.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 969, \"totalTestResults\": 866, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": 5.515809423282292, \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": 0.0, \"positive_diff_100k\": 0.0, \"death_diff_100k\": 0.0, \"total_10\": 96.9}, {\"date\": \"2020-03-05T00:00:00\", \"positive\": 176.0, \"negative\": 953.0, \"pending\": 197.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 1326, \"totalTestResults\": 1129, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 99.0, \"positiveIncrease\": 55.0, \"totalTestResultsIncrease\": 154.0, \"ratio\": 7.691963187672735, \"positive_diff\": 55.0, \"negative_diff\": 99.0, \"death_diff\": 0.0, \"positive_diff_100k\": 0.5298275537038083, \"death_diff_100k\": 0.0, \"total_10\": 132.59999999999997}, {\"date\": \"2020-03-06T00:00:00\", \"positive\": 223.0, \"negative\": 1571.0, \"pending\": 458.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 2252, \"totalTestResults\": 1794, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 507.0, \"positiveIncrease\": 44.0, \"totalTestResultsIncrease\": 551.0, \"ratio\": 8.84189813481705, \"positive_diff\": 44.0, \"negative_diff\": 137.0, \"death_diff\": 0.0, \"positive_diff_100k\": 0.4002079423948694, \"death_diff_100k\": 0.0, \"total_10\": 225.2}, {\"date\": \"2020-03-07T00:00:00\", \"positive\": 341.0, \"negative\": 1809.0, \"pending\": 602.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 2752, \"totalTestResults\": 2150, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 194.0, \"positiveIncrease\": 113.0, \"totalTestResultsIncrease\": 307.0, \"ratio\": 13.209662158531827, \"positive_diff\": 113.0, \"negative_diff\": 194.0, \"death_diff\": 0.0, \"positive_diff_100k\": 1.0879306092476013, \"death_diff_100k\": 0.0, \"total_10\": 275.2}, {\"date\": \"2020-03-08T00:00:00\", \"positive\": 417.0, \"negative\": 2335.0, \"pending\": 347.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 3099, \"totalTestResults\": 2752, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 526.0, \"positiveIncrease\": 76.0, \"totalTestResultsIncrease\": 602.0, \"ratio\": 12.32417291309689, \"positive_diff\": 76.0, \"negative_diff\": 423.0, \"death_diff\": 0.0, \"positive_diff_100k\": 1.114311671083663, \"death_diff_100k\": 0.0, \"total_10\": 309.9}, {\"date\": \"2020-03-09T00:00:00\", \"positive\": 584.0, \"negative\": 3367.0, \"pending\": 313.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 4264, \"totalTestResults\": 3951, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1032.0, \"positiveIncrease\": 167.0, \"totalTestResultsIncrease\": 1199.0, \"ratio\": 12.85071660526928, \"positive_diff\": 167.0, \"negative_diff\": 1032.0, \"death_diff\": 0.0, \"positive_diff_100k\": 1.8189942831236092, \"death_diff_100k\": 0.0, \"total_10\": 426.3999999999999}, {\"date\": \"2020-03-10T00:00:00\", \"positive\": 778.0, \"negative\": 3807.0, \"pending\": 469.0, \"hospitalized\": 0.0, \"death\": 0.0, \"total\": 5054, \"totalTestResults\": 4585, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 440.0, \"positiveIncrease\": 195.0, \"totalTestResultsIncrease\": 634.0, \"ratio\": 12.154127882707202, \"positive_diff\": 194.0, \"negative_diff\": 410.0, \"death_diff\": 0.0, \"positive_diff_100k\": 2.7039844813891034, \"death_diff_100k\": 0.0, \"total_10\": 505.4}, {\"date\": \"2020-03-11T00:00:00\", \"positive\": 1053.0, \"negative\": 6070.0, \"pending\": 563.0, \"hospitalized\": 0.0, \"death\": 27.0, \"total\": 7709, \"totalTestResults\": 7123, \"deathIncrease\": 27.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2263.0, \"positiveIncrease\": 275.0, \"totalTestResultsIncrease\": 2538.0, \"ratio\": 10.910107691066283, \"positive_diff\": 275.0, \"negative_diff\": 2105.0, \"death_diff\": 0.0, \"positive_diff_100k\": 4.019334743734134, \"death_diff_100k\": 0.0, \"total_10\": 770.9}, {\"date\": \"2020-03-12T00:00:00\", \"positive\": 1315.0, \"negative\": 8041.0, \"pending\": 673.0, \"hospitalized\": 0.0, \"death\": 36.0, \"total\": 10058, \"totalTestResults\": 9356, \"deathIncrease\": 9.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1971.0, \"positiveIncrease\": 262.0, \"totalTestResultsIncrease\": 2233.0, \"ratio\": 9.755804331526067, \"positive_diff\": 262.0, \"negative_diff\": 1716.0, \"death_diff\": 5.0, \"positive_diff_100k\": 5.624305797598059, \"death_diff_100k\": 0.06566080442627362, \"total_10\": 1005.8000000000001}, {\"date\": \"2020-03-13T00:00:00\", \"positive\": 1922.0, \"negative\": 13613.0, \"pending\": 1130.0, \"hospitalized\": 0.0, \"death\": 39.0, \"total\": 16665, \"totalTestResults\": 15535, \"deathIncrease\": 3.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 5572.0, \"positiveIncrease\": 607.0, \"totalTestResultsIncrease\": 6179.0, \"ratio\": 9.175450650028257, \"positive_diff\": 607.0, \"negative_diff\": 5480.0, \"death_diff\": 2.0, \"positive_diff_100k\": 8.020087301519814, \"death_diff_100k\": 0.026264321770509448, \"total_10\": 1666.5000000000005}, {\"date\": \"2020-03-14T00:00:00\", \"positive\": 2450.0, \"negative\": 17102.0, \"pending\": 1236.0, \"hospitalized\": 0.0, \"death\": 49.0, \"total\": 20789, \"totalTestResults\": 19552, \"deathIncrease\": 10.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 3489.0, \"positiveIncrease\": 528.0, \"totalTestResultsIncrease\": 4017.0, \"ratio\": 8.811365861432826, \"positive_diff\": 528.0, \"negative_diff\": 3489.0, \"death_diff\": 8.0, \"positive_diff_100k\": 7.522230821043739, \"death_diff_100k\": 0.08597981173139377, \"total_10\": 2078.9}, {\"date\": \"2020-03-15T00:00:00\", \"positive\": 3173.0, \"negative\": 22548.0, \"pending\": 2242.0, \"hospitalized\": 0.0, \"death\": 60.0, \"total\": 27963, \"totalTestResults\": 25721, \"deathIncrease\": 11.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 5446.0, \"positiveIncrease\": 723.0, \"totalTestResultsIncrease\": 6169.0, \"ratio\": 9.136862838236842, \"positive_diff\": 723.0, \"negative_diff\": 5446.0, \"death_diff\": 5.0, \"positive_diff_100k\": 9.736170827916586, \"death_diff_100k\": 0.05531095133927636, \"total_10\": 2796.3}, {\"date\": \"2020-03-16T00:00:00\", \"positive\": 4019.0, \"negative\": 36104.0, \"pending\": 1691.0, \"hospitalized\": 0.0, \"death\": 71.0, \"total\": 41714, \"totalTestResults\": 40123, \"deathIncrease\": 11.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 13524.0, \"positiveIncrease\": 837.0, \"totalTestResultsIncrease\": 14361.0, \"ratio\": 11.220932181161599, \"positive_diff\": 837.0, \"negative_diff\": 13524.0, \"death_diff\": 8.0, \"positive_diff_100k\": 12.105280688881605, \"death_diff_100k\": 0.06421091573267143, \"total_10\": 4171.400000000001}, {\"date\": \"2020-03-17T00:00:00\", \"positive\": 5723.0, \"negative\": 47604.0, \"pending\": 1687.0, \"hospitalized\": 0.0, \"death\": 90.0, \"total\": 54957, \"totalTestResults\": 53327, \"deathIncrease\": 19.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 11500.0, \"positiveIncrease\": 1704.0, \"totalTestResultsIncrease\": 13204.0, \"ratio\": 9.740374437510395, \"positive_diff\": 1704.0, \"negative_diff\": 10201.0, \"death_diff\": 17.0, \"positive_diff_100k\": 20.726028204722564, \"death_diff_100k\": 0.16989358409385108, \"total_10\": 5495.699999999999}, {\"date\": \"2020-03-18T00:00:00\", \"positive\": 7731.0, \"negative\": 66225.0, \"pending\": 2538.0, \"hospitalized\": 0.0, \"death\": 112.0, \"total\": 76495, \"totalTestResults\": 73956, \"deathIncrease\": 22.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 18621.0, \"positiveIncrease\": 2008.0, \"totalTestResultsIncrease\": 20629.0, \"ratio\": 8.606556459953612, \"positive_diff\": 2008.0, \"negative_diff\": 17217.0, \"death_diff\": 18.0, \"positive_diff_100k\": 27.530078336913014, \"death_diff_100k\": 0.1743011549896832, \"total_10\": 7649.499999999999}, {\"date\": \"2020-03-19T00:00:00\", \"positive\": 11723.0, \"negative\": 89119.0, \"pending\": 3025.0, \"hospitalized\": 0.0, \"death\": 160.0, \"total\": 103867, \"totalTestResults\": 100842, \"deathIncrease\": 48.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 22894.0, \"positiveIncrease\": 3992.0, \"totalTestResultsIncrease\": 26886.0, \"ratio\": 8.456727153467822, \"positive_diff\": 3992.0, \"negative_diff\": 22894.0, \"death_diff\": 41.0, \"positive_diff_100k\": 41.05592023137221, \"death_diff_100k\": 0.4291152914332691, \"total_10\": 10386.7}, {\"date\": \"2020-03-20T00:00:00\", \"positive\": 17038.0, \"negative\": 118147.0, \"pending\": 3336.0, \"hospitalized\": 0.0, \"death\": 219.0, \"total\": 138521, \"totalTestResults\": 135185, \"deathIncrease\": 59.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 29028.0, \"positiveIncrease\": 5315.0, \"totalTestResultsIncrease\": 34343.0, \"ratio\": 8.865717119784163, \"positive_diff\": 5315.0, \"negative_diff\": 29028.0, \"death_diff\": 51.0, \"positive_diff_100k\": 59.019736282820595, \"death_diff_100k\": 0.6044213757021897, \"total_10\": 13852.100000000002}, {\"date\": \"2020-03-21T00:00:00\", \"positive\": 23203.0, \"negative\": 155909.0, \"pending\": 3477.0, \"hospitalized\": 1964.0, \"death\": 272.0, \"total\": 182589, \"totalTestResults\": 179112, \"deathIncrease\": 53.0, \"hospitalizedIncrease\": 1964.0, \"negativeIncrease\": 37762.0, \"positiveIncrease\": 6165.0, \"totalTestResultsIncrease\": 43927.0, \"ratio\": 8.860167677919787, \"positive_diff\": 6165.0, \"negative_diff\": 37762.0, \"death_diff\": 52.0, \"positive_diff_100k\": 60.68561036861707, \"death_diff_100k\": 0.6328191310140254, \"total_10\": 18258.9}, {\"date\": \"2020-03-22T00:00:00\", \"positive\": 31888.0, \"negative\": 193463.0, \"pending\": 2842.0, \"hospitalized\": 2554.0, \"death\": 398.0, \"total\": 228193, \"totalTestResults\": 225351, \"deathIncrease\": 126.0, \"hospitalizedIncrease\": 590.0, \"negativeIncrease\": 37554.0, \"positiveIncrease\": 8685.0, \"totalTestResultsIncrease\": 46239.0, \"ratio\": 8.682420844191617, \"positive_diff\": 8685.0, \"negative_diff\": 37554.0, \"death_diff\": 125.0, \"positive_diff_100k\": 90.83601730037192, \"death_diff_100k\": 1.1021669130972207, \"total_10\": 22819.299999999992}, {\"date\": \"2020-03-23T00:00:00\", \"positive\": 42164.0, \"negative\": 237321.0, \"pending\": 14571.0, \"hospitalized\": 3325.0, \"death\": 471.0, \"total\": 294056, \"totalTestResults\": 279485, \"deathIncrease\": 73.0, \"hospitalizedIncrease\": 771.0, \"negativeIncrease\": 43858.0, \"positiveIncrease\": 10276.0, \"totalTestResultsIncrease\": 54134.0, \"ratio\": 9.16638131274229, \"positive_diff\": 10276.0, \"negative_diff\": 43858.0, \"death_diff\": 69.0, \"positive_diff_100k\": 104.21967277706064, \"death_diff_100k\": 1.6099082141188321, \"total_10\": 29405.60000000001}, {\"date\": \"2020-03-24T00:00:00\", \"positive\": 51970.0, \"negative\": 292758.0, \"pending\": 14433.0, \"hospitalized\": 4468.0, \"death\": 675.0, \"total\": 359161, \"totalTestResults\": 344728, \"deathIncrease\": 204.0, \"hospitalizedIncrease\": 1143.0, \"negativeIncrease\": 55437.0, \"positiveIncrease\": 9806.0, \"totalTestResultsIncrease\": 65243.0, \"ratio\": 8.657825914993454, \"positive_diff\": 9806.0, \"negative_diff\": 55437.0, \"death_diff\": 202.0, \"positive_diff_100k\": 104.78829824072378, \"death_diff_100k\": 2.0762435813455027, \"total_10\": 35916.10000000001}, {\"date\": \"2020-03-25T00:00:00\", \"positive\": 63675.0, \"negative\": 355135.0, \"pending\": 14735.0, \"hospitalized\": 6136.0, \"death\": 887.0, \"total\": 433545, \"totalTestResults\": 418810, \"deathIncrease\": 212.0, \"hospitalizedIncrease\": 1668.0, \"negativeIncrease\": 62377.0, \"positiveIncrease\": 11705.0, \"totalTestResultsIncrease\": 74082.0, \"ratio\": 7.701237998330187, \"positive_diff\": 11705.0, \"negative_diff\": 62322.0, \"death_diff\": 209.0, \"positive_diff_100k\": 139.11950696793798, \"death_diff_100k\": 2.5297487711918536, \"total_10\": 43354.500000000015}]}}, {\"mode\": \"vega-lite\"});\n",
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
"</script>"
],
"text/plain": [
"alt.VConcatChart(...)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"<p style=\"font-size: smaller\">Data Sources: \n",
" <a href=\"https://covidtracking.com\">The COVID Tracking Project</a>\n",
"<br>\n",
"Analysis and Visualization:\n",
" <a href=\"https://renkulab.io/projects/covid-19/covid-19-public-data\">Covid-19 Public Data Collaboration Project</a>\n",
"</p>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"base = alt.Chart(\n",
" daily_totals\n",
").mark_bar(size=15).encode(\n",
" alt.X('date', axis=alt.Axis(title='')\n",
" )\n",
")\n",
"\n",
"cumulative = base.encode(alt.Y('positive', title = 'Cumulative cases'))\n",
"cumulative_deaths = base.encode(alt.Y('death', title = 'Cumulative deaths'))\n",
"rates = base.encode(alt.Y('positive_diff', title='Daily cases'))\n",
"rates_deaths = base.encode(alt.Y('death_diff', title='Daily deaths'))\n",
"chart = alt.vconcat(\n",
" cumulative | rates, cumulative_deaths | rates_deaths,\n",
" title='Cumulative Covid-19 cases in the U.S.'\n",
").configure_title(\n",
" anchor='middle'\n",
")\n",
"display(chart)\n",
"display(html_credits)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Total tests and positives per 100k population"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Most recent test date 2020-03-25 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.\")\n",
"\n",
"most_recent_df['total/100k'] = (most_recent_df['total'] / pop_df['Population']) * 100000\n",
"most_recent_df['positive/100k'] = (most_recent_df['positive'] / pop_df['Population']) * 100000\n",
"most_recent_df = most_recent_df.reset_index()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div id=\"altair-viz-2cbc1f63dc73456592a7ae2db5069802\"></div>\n",
"<script type=\"text/javascript\">\n",
" (function(spec, embedOpt){\n",
" const outputDiv = document.getElementById(\"altair-viz-2cbc1f63dc73456592a7ae2db5069802\");\n",
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
" 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\": \"bar\", \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"state\", \"sort\": null}, \"y\": {\"type\": \"quantitative\", \"field\": \"total/100k\"}}, \"title\": \"Cases per 100k\"}, {\"mark\": {\"type\": \"point\", \"color\": \"orange\", \"filled\": true, \"opacity\": 1, \"size\": 100}, \"encoding\": {\"x\": {\"type\": \"nominal\", \"field\": \"state\", \"sort\": null}, \"y\": {\"type\": \"quantitative\", \"field\": \"positive/100k\"}}, \"title\": \"Cases per 100k\"}], \"data\": {\"name\": \"data-96bf7010ae6df72729adf13919842acb\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-96bf7010ae6df72729adf13919842acb\": [{\"state\": \"MD\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 423.0, \"negative\": 94.0, \"pending\": null, \"hospitalized\": null, \"death\": 4.0, \"total\": 517, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 517, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 74.0, \"totalTestResultsIncrease\": 74.0, \"ratio\": 0.8181818181818182, \"total/100k\": 8.551560783898585, \"positive/100k\": 6.996731550462479}, {\"state\": \"AZ\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 450.0, \"negative\": 323.0, \"pending\": 53.0, \"hospitalized\": 8.0, \"death\": 6.0, \"total\": 826, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 773, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 10.0, \"positiveIncrease\": 93.0, \"totalTestResultsIncrease\": 103.0, \"ratio\": 0.5447941888619855, \"total/100k\": 11.348153802380281, \"positive/100k\": 6.182408245848822}, {\"state\": \"MO\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 356.0, \"negative\": 369.0, \"pending\": null, \"hospitalized\": null, \"death\": 8.0, \"total\": 725, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 725, \"deathIncrease\": 5.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 173.0, \"totalTestResultsIncrease\": 173.0, \"ratio\": 0.4910344827586207, \"total/100k\": 11.812765868699396, \"positive/100k\": 5.800475378285497}, {\"state\": \"DE\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 115.0, \"negative\": 36.0, \"pending\": null, \"hospitalized\": 11.0, \"death\": 0.0, \"total\": 151, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 151, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 11.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 24.0, \"totalTestResultsIncrease\": 24.0, \"ratio\": 0.7615894039735099, \"total/100k\": 15.506837385649911, \"positive/100k\": 11.809843042051256}, {\"state\": \"OK\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 164.0, \"negative\": 805.0, \"pending\": null, \"hospitalized\": 59.0, \"death\": 5.0, \"total\": 969, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 969, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 34.0, \"negativeIncrease\": 70.0, \"positiveIncrease\": 58.0, \"totalTestResultsIncrease\": 128.0, \"ratio\": 0.1692466460268318, \"total/100k\": 24.488428143648257, \"positive/100k\": 4.144584329781543}, {\"state\": \"MI\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 2294.0, \"negative\": 2069.0, \"pending\": null, \"hospitalized\": null, \"death\": 43.0, \"total\": 4363, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 4363, \"deathIncrease\": 19.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 503.0, \"totalTestResultsIncrease\": 503.0, \"ratio\": 0.5257850103140042, \"total/100k\": 43.6874183739689, \"positive/100k\": 22.970189720349456}, {\"state\": \"WV\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 39.0, \"negative\": 759.0, \"pending\": 6.0, \"hospitalized\": 1.0, \"death\": 0.0, \"total\": 804, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 798, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 149.0, \"positiveIncrease\": 19.0, \"totalTestResultsIncrease\": 168.0, \"ratio\": 0.048507462686567165, \"total/100k\": 44.98790530381664, \"positive/100k\": 2.182249137871703}, {\"state\": \"TX\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 974.0, \"negative\": 12520.0, \"pending\": null, \"hospitalized\": null, \"death\": 12.0, \"total\": 13494, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 13494, \"deathIncrease\": 3.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1763.0, \"positiveIncrease\": 564.0, \"totalTestResultsIncrease\": 2327.0, \"ratio\": 0.07218022824959242, \"total/100k\": 46.53764443301447, \"positive/100k\": 3.359097797373358}, {\"state\": \"IN\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 477.0, \"negative\": 2879.0, \"pending\": null, \"hospitalized\": 1.0, \"death\": 14.0, \"total\": 3356, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 3356, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 313.0, \"positiveIncrease\": 112.0, \"totalTestResultsIncrease\": 425.0, \"ratio\": 0.14213349225268176, \"total/100k\": 49.84983405917128, \"positive/100k\": 7.085331003046693}, {\"state\": \"SC\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 424.0, \"negative\": 2303.0, \"pending\": null, \"hospitalized\": 102.0, \"death\": 7.0, \"total\": 2727, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 2727, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 102.0, \"negativeIncrease\": 291.0, \"positiveIncrease\": 126.0, \"totalTestResultsIncrease\": 417.0, \"ratio\": 0.15548221488815547, \"total/100k\": 52.96468205458684, \"positive/100k\": 8.235066076694102}, {\"state\": \"AR\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 280.0, \"negative\": 1437.0, \"pending\": 0.0, \"hospitalized\": 22.0, \"death\": 2.0, \"total\": 1717, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1717, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 490.0, \"positiveIncrease\": 62.0, \"totalTestResultsIncrease\": 552.0, \"ratio\": 0.163075131042516, \"total/100k\": 56.89528054144956, \"positive/100k\": 9.278205329997597}, {\"state\": \"AL\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 283.0, \"negative\": 2529.0, \"pending\": null, \"hospitalized\": null, \"death\": 0.0, \"total\": 2812, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 2812, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 423.0, \"positiveIncrease\": 68.0, \"totalTestResultsIncrease\": 491.0, \"ratio\": 0.10064011379800854, \"total/100k\": 57.35047729180115, \"positive/100k\": 5.771758561016972}, {\"state\": \"GA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 1247.0, \"negative\": 4932.0, \"pending\": null, \"hospitalized\": 394.0, \"death\": 40.0, \"total\": 6179, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 6179, \"deathIncrease\": 8.0, \"hospitalizedIncrease\": 394.0, \"negativeIncrease\": 474.0, \"positiveIncrease\": 221.0, \"totalTestResultsIncrease\": 695.0, \"ratio\": 0.20181259103414792, \"total/100k\": 58.19679596451982, \"positive/100k\": 11.744846183485391}, {\"state\": \"VA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 391.0, \"negative\": 4979.0, \"pending\": null, \"hospitalized\": 59.0, \"death\": 9.0, \"total\": 5370, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 5370, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 14.0, \"negativeIncrease\": 799.0, \"positiveIncrease\": 101.0, \"totalTestResultsIncrease\": 900.0, \"ratio\": 0.07281191806331472, \"total/100k\": 62.91357326953405, \"positive/100k\": 4.58085794197166}, {\"state\": \"MS\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 377.0, \"negative\": 1566.0, \"pending\": null, \"hospitalized\": 117.0, \"death\": 2.0, \"total\": 1943, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1943, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 31.0, \"negativeIncrease\": 14.0, \"positiveIncrease\": 57.0, \"totalTestResultsIncrease\": 71.0, \"ratio\": 0.19402985074626866, \"total/100k\": 65.28570982165208, \"positive/100k\": 12.66737653255936}, {\"state\": \"KY\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 157.0, \"negative\": 2865.0, \"pending\": null, \"hospitalized\": null, \"death\": 4.0, \"total\": 3022, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 3022, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1123.0, \"positiveIncrease\": 33.0, \"totalTestResultsIncrease\": 1156.0, \"ratio\": 0.051952349437458634, \"total/100k\": 67.64147689412363, \"positive/100k\": 3.5141336440692954}, {\"state\": \"CA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 2102.0, \"negative\": 13452.0, \"pending\": 12100.0, \"hospitalized\": null, \"death\": 40.0, \"total\": 27654, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 15554, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": 0.0760107036956679, \"total/100k\": 69.98846913776529, \"positive/100k\": 5.319872789744075}, {\"state\": \"NE\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 61.0, \"negative\": 1304.0, \"pending\": null, \"hospitalized\": null, \"death\": 0.0, \"total\": 1365, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1365, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 329.0, \"positiveIncrease\": 9.0, \"totalTestResultsIncrease\": 338.0, \"ratio\": 0.04468864468864469, \"total/100k\": 70.56422430014764, \"positive/100k\": 3.1534195474791256}, {\"state\": \"FL\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 1682.0, \"negative\": 15374.0, \"pending\": 1233.0, \"hospitalized\": 316.0, \"death\": 22.0, \"total\": 18289, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 17056, \"deathIncrease\": 4.0, \"hospitalizedIncrease\": 57.0, \"negativeIncrease\": 2247.0, \"positiveIncrease\": 270.0, \"totalTestResultsIncrease\": 2517.0, \"ratio\": 0.09196784952703811, \"total/100k\": 85.15329152228654, \"positive/100k\": 7.831365101453659}, {\"state\": \"KS\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 126.0, \"negative\": 2360.0, \"pending\": null, \"hospitalized\": null, \"death\": 3.0, \"total\": 2486, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 2486, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 274.0, \"positiveIncrease\": 28.0, \"totalTestResultsIncrease\": 302.0, \"ratio\": 0.050683829444891394, \"total/100k\": 85.33237405923289, \"positive/100k\": 4.324971492945834}, {\"state\": \"IA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 145.0, \"negative\": 2578.0, \"pending\": null, \"hospitalized\": 36.0, \"death\": 1.0, \"total\": 2723, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 2723, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 9.0, \"negativeIncrease\": 263.0, \"positiveIncrease\": 21.0, \"totalTestResultsIncrease\": 284.0, \"ratio\": 0.05325009181050312, \"total/100k\": 86.30553363316821, \"positive/100k\": 4.595777589720672}, {\"state\": \"PA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 1127.0, \"negative\": 11193.0, \"pending\": null, \"hospitalized\": null, \"death\": 11.0, \"total\": 12320, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 12320, \"deathIncrease\": 4.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2550.0, \"positiveIncrease\": 276.0, \"totalTestResultsIncrease\": 2826.0, \"ratio\": 0.09147727272727273, \"total/100k\": 96.23504597605888, \"positive/100k\": 8.803319546673569}, {\"state\": \"NC\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 504.0, \"negative\": 9985.0, \"pending\": null, \"hospitalized\": 29.0, \"death\": 1.0, \"total\": 10489, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 10489, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 29.0, \"negativeIncrease\": 1844.0, \"positiveIncrease\": 106.0, \"totalTestResultsIncrease\": 1950.0, \"ratio\": 0.04805033844980456, \"total/100k\": 100.00873372104952, \"positive/100k\": 4.805453503232812}, {\"state\": \"OR\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 209.0, \"negative\": 4350.0, \"pending\": null, \"hospitalized\": 61.0, \"death\": 8.0, \"total\": 4559, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 4559, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": 0.04584338670761132, \"total/100k\": 108.09113986955563, \"positive/100k\": 4.955263924706543}, {\"state\": \"ID\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 73.0, \"negative\": 1887.0, \"pending\": null, \"hospitalized\": null, \"death\": 0.0, \"total\": 1960, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1960, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 23.0, \"totalTestResultsIncrease\": 23.0, \"ratio\": 0.037244897959183676, \"total/100k\": 109.37103285874117, \"positive/100k\": 4.07351295851434}, {\"state\": \"IL\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 1865.0, \"negative\": 12344.0, \"pending\": null, \"hospitalized\": null, \"death\": 19.0, \"total\": 14209, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 14209, \"deathIncrease\": 3.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2410.0, \"positiveIncrease\": 314.0, \"totalTestResultsIncrease\": 2724.0, \"ratio\": 0.13125483848265185, \"total/100k\": 112.13068745210337, \"positive/100k\": 14.717695270474545}, {\"state\": \"OH\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 704.0, \"negative\": 14060.0, \"pending\": null, \"hospitalized\": 182.0, \"death\": 10.0, \"total\": 14764, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 14764, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 37.0, \"negativeIncrease\": 13920.0, \"positiveIncrease\": 140.0, \"totalTestResultsIncrease\": 14060.0, \"ratio\": 0.047683554592251425, \"total/100k\": 126.30570360421247, \"positive/100k\": 6.022704913124192}, {\"state\": \"SD\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 41.0, \"negative\": 819.0, \"pending\": 268.0, \"hospitalized\": null, \"death\": 1.0, \"total\": 1128, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 860, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 29.0, \"positiveIncrease\": 11.0, \"totalTestResultsIncrease\": 40.0, \"ratio\": 0.03634751773049645, \"total/100k\": 127.5067568407714, \"positive/100k\": 4.634554105028039}, {\"state\": \"CO\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 912.0, \"negative\": 6789.0, \"pending\": null, \"hospitalized\": 84.0, \"death\": 11.0, \"total\": 7701, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 7701, \"deathIncrease\": 4.0, \"hospitalizedIncrease\": 12.0, \"negativeIncrease\": 1285.0, \"positiveIncrease\": 192.0, \"totalTestResultsIncrease\": 1477.0, \"ratio\": 0.11842617841838722, \"total/100k\": 133.72726237146486, \"positive/100k\": 15.836808633005578}, {\"state\": \"RI\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 124.0, \"negative\": 1143.0, \"pending\": 196.0, \"hospitalized\": 16.0, \"death\": null, \"total\": 1463, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1267, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 16.0, \"negativeIncrease\": 23.0, \"positiveIncrease\": 18.0, \"totalTestResultsIncrease\": 41.0, \"ratio\": 0.08475734791524266, \"total/100k\": 138.10212005161603, \"positive/100k\": 11.705169437047427}, {\"state\": \"NV\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 321.0, \"negative\": 4251.0, \"pending\": 0.0, \"hospitalized\": null, \"death\": 6.0, \"total\": 4572, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 4572, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 297.0, \"positiveIncrease\": 43.0, \"totalTestResultsIncrease\": 340.0, \"ratio\": 0.07020997375328084, \"total/100k\": 148.43404035380027, \"positive/100k\": 10.421550077333746}, {\"state\": \"CT\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 875.0, \"negative\": 5023.0, \"pending\": null, \"hospitalized\": 113.0, \"death\": 19.0, \"total\": 5898, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 5898, \"deathIncrease\": 7.0, \"hospitalizedIncrease\": 42.0, \"negativeIncrease\": 341.0, \"positiveIncrease\": 257.0, \"totalTestResultsIncrease\": 598.0, \"ratio\": 0.14835537470328924, \"total/100k\": 165.42847742692243, \"positive/100k\": 24.542203755265703}, {\"state\": \"NJ\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 4402.0, \"negative\": 10452.0, \"pending\": null, \"hospitalized\": null, \"death\": 62.0, \"total\": 14854, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 14854, \"deathIncrease\": 18.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2127.0, \"positiveIncrease\": 727.0, \"totalTestResultsIncrease\": 2854.0, \"ratio\": 0.2963511512050626, \"total/100k\": 167.2335313700788, \"positive/100k\": 49.559849541610795}, {\"state\": \"WY\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 44.0, \"negative\": 954.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 998, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 998, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 244.0, \"positiveIncrease\": 15.0, \"totalTestResultsIncrease\": 259.0, \"ratio\": 0.04408817635270541, \"total/100k\": 172.43792321156127, \"positive/100k\": 7.602473568445587}, {\"state\": \"TN\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 784.0, \"negative\": 11012.0, \"pending\": null, \"hospitalized\": 53.0, \"death\": 3.0, \"total\": 11796, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 11796, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 53.0, \"negativeIncrease\": 495.0, \"positiveIncrease\": 117.0, \"totalTestResultsIncrease\": 612.0, \"ratio\": 0.06646320786707359, \"total/100k\": 172.62841543329645, \"positive/100k\": 11.473438258706715}, {\"state\": \"WI\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 585.0, \"negative\": 10089.0, \"pending\": null, \"hospitalized\": null, \"death\": 7.0, \"total\": 10674, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 10674, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1852.0, \"positiveIncrease\": 128.0, \"totalTestResultsIncrease\": 1980.0, \"ratio\": 0.05480607082630692, \"total/100k\": 183.32539278246864, \"positive/100k\": 10.047344461096511}, {\"state\": \"MT\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 53.0, \"negative\": 1948.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 2001, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 2001, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 305.0, \"positiveIncrease\": 7.0, \"totalTestResultsIncrease\": 312.0, \"ratio\": 0.026486756621689155, \"total/100k\": 187.22316514748618, \"positive/100k\": 4.958934409203782}, {\"state\": \"MN\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 287.0, \"negative\": 11188.0, \"pending\": null, \"hospitalized\": 35.0, \"death\": 1.0, \"total\": 11475, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 11475, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 14.0, \"negativeIncrease\": 5638.0, \"positiveIncrease\": 25.0, \"totalTestResultsIncrease\": 5663.0, \"ratio\": 0.025010893246187365, \"total/100k\": 203.470722912417, \"positive/100k\": 5.08898452948703}, {\"state\": \"UT\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 346.0, \"negative\": 6491.0, \"pending\": null, \"hospitalized\": null, \"death\": 1.0, \"total\": 6837, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 6837, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 967.0, \"positiveIncrease\": 47.0, \"totalTestResultsIncrease\": 1014.0, \"ratio\": 0.05060699137048413, \"total/100k\": 213.2591880492508, \"positive/100k\": 10.792405889284888}, {\"state\": \"DC\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 183.0, \"negative\": 1423.0, \"pending\": 3.0, \"hospitalized\": null, \"death\": 2.0, \"total\": 1609, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1606, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 228.0, \"positiveIncrease\": 46.0, \"totalTestResultsIncrease\": 274.0, \"ratio\": 0.11373523927905531, \"total/100k\": 227.9847367831906, \"positive/100k\": 25.929898590008627}, {\"state\": \"AK\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 42.0, \"negative\": 1649.0, \"pending\": null, \"hospitalized\": 1.0, \"death\": 1.0, \"total\": 1691, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1691, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 1.0, \"negativeIncrease\": 663.0, \"positiveIncrease\": 6.0, \"totalTestResultsIncrease\": 669.0, \"ratio\": 0.024837374334713187, \"total/100k\": 231.15461113123592, \"positive/100k\": 5.741273605861567}, {\"state\": \"ND\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 39.0, \"negative\": 1734.0, \"pending\": null, \"hospitalized\": 8.0, \"death\": 0.0, \"total\": 1773, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1773, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 3.0, \"negativeIncrease\": 280.0, \"positiveIncrease\": 5.0, \"totalTestResultsIncrease\": 285.0, \"ratio\": 0.021996615905245348, \"total/100k\": 232.65823515671954, \"positive/100k\": 5.117693835934609}, {\"state\": \"NH\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 108.0, \"negative\": 2356.0, \"pending\": 804.0, \"hospitalized\": 13.0, \"death\": 1.0, \"total\": 3268, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 2464, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 2.0, \"negativeIncrease\": 909.0, \"positiveIncrease\": 7.0, \"totalTestResultsIncrease\": 916.0, \"ratio\": 0.033047735618115054, \"total/100k\": 240.34519100014634, \"positive/100k\": 7.942864329258203}, {\"state\": \"LA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 1795.0, \"negative\": 9656.0, \"pending\": null, \"hospitalized\": 491.0, \"death\": 65.0, \"total\": 11451, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 11451, \"deathIncrease\": 19.0, \"hospitalizedIncrease\": 220.0, \"negativeIncrease\": 2441.0, \"positiveIncrease\": 407.0, \"totalTestResultsIncrease\": 2848.0, \"ratio\": 0.15675486857043053, \"total/100k\": 246.32194930556184, \"positive/100k\": 38.6121647894056}, {\"state\": \"ME\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 149.0, \"negative\": 3177.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 3326, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 3326, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 163.0, \"positiveIncrease\": 24.0, \"totalTestResultsIncrease\": 187.0, \"ratio\": 0.04479855682501503, \"total/100k\": 247.4312087676646, \"positive/100k\": 11.084561066260381}, {\"state\": \"VT\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 123.0, \"negative\": 1589.0, \"pending\": null, \"hospitalized\": null, \"death\": 8.0, \"total\": 1712, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 1712, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 149.0, \"positiveIncrease\": 28.0, \"totalTestResultsIncrease\": 177.0, \"ratio\": 0.07184579439252337, \"total/100k\": 274.36381090051265, \"positive/100k\": 19.711885946707394}, {\"state\": \"MA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 1838.0, \"negative\": 17956.0, \"pending\": null, \"hospitalized\": 103.0, \"death\": 15.0, \"total\": 19794, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 19794, \"deathIncrease\": 4.0, \"hospitalizedIncrease\": 9.0, \"negativeIncrease\": 5366.0, \"positiveIncrease\": 679.0, \"totalTestResultsIncrease\": 6045.0, \"ratio\": 0.0928564211377185, \"total/100k\": 284.82612353717957, \"positive/100k\": 26.447934478192177}, {\"state\": \"HI\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 90.0, \"negative\": 4357.0, \"pending\": null, \"hospitalized\": 6.0, \"death\": 1.0, \"total\": 4447, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 4447, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 2.0, \"negativeIncrease\": 768.0, \"positiveIncrease\": 13.0, \"totalTestResultsIncrease\": 781.0, \"ratio\": 0.02023836294130875, \"total/100k\": 314.08206391538215, \"positive/100k\": 6.3565068028748355}, {\"state\": \"NM\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 100.0, \"negative\": 6742.0, \"pending\": null, \"hospitalized\": null, \"death\": 1.0, \"total\": 6842, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 6842, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 852.0, \"positiveIncrease\": 17.0, \"totalTestResultsIncrease\": 869.0, \"ratio\": 0.014615609470914937, \"total/100k\": 326.3022401922141, \"positive/100k\": 4.769106112134085}, {\"state\": \"WA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 2469.0, \"negative\": 31712.0, \"pending\": null, \"hospitalized\": null, \"death\": 123.0, \"total\": 34181, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 34181, \"deathIncrease\": 13.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 248.0, \"totalTestResultsIncrease\": 248.0, \"ratio\": 0.07223311196278634, \"total/100k\": 448.87039121889177, \"positive/100k\": 32.42330522569391}, {\"state\": \"NY\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 30811.0, \"negative\": 72668.0, \"pending\": null, \"hospitalized\": 3805.0, \"death\": 285.0, \"total\": 103479, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 103479, \"deathIncrease\": 75.0, \"hospitalizedIncrease\": 571.0, \"negativeIncrease\": 7063.0, \"positiveIncrease\": 5146.0, \"totalTestResultsIncrease\": 12209.0, \"ratio\": 0.2977512345500053, \"total/100k\": 531.9283189334848, \"positive/100k\": 158.38231365455403}, {\"state\": \"AS\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 0.0, \"negative\": null, \"pending\": null, \"hospitalized\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 0, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": null, \"total/100k\": null, \"positive/100k\": null}, {\"state\": \"GU\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 37.0, \"negative\": 233.0, \"pending\": null, \"hospitalized\": 10.0, \"death\": 1.0, \"total\": 270, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 270, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 5.0, \"negativeIncrease\": 32.0, \"positiveIncrease\": 5.0, \"totalTestResultsIncrease\": 37.0, \"ratio\": 0.13703703703703704, \"total/100k\": null, \"positive/100k\": null}, {\"state\": \"MP\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 0.0, \"negative\": null, \"pending\": null, \"hospitalized\": null, \"death\": 0.0, \"total\": 0, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 0, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": null, \"total/100k\": null, \"positive/100k\": null}, {\"state\": \"PR\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 51.0, \"negative\": 317.0, \"pending\": 70.0, \"hospitalized\": null, \"death\": 2.0, \"total\": 438, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 368, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 49.0, \"positiveIncrease\": 12.0, \"totalTestResultsIncrease\": 61.0, \"ratio\": 0.11643835616438356, \"total/100k\": null, \"positive/100k\": null}, {\"state\": \"VI\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 17.0, \"negative\": 55.0, \"pending\": 2.0, \"hospitalized\": null, \"death\": 0.0, \"total\": 74, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 72, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 55.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 55.0, \"ratio\": 0.22972972972972974, \"total/100k\": null, \"positive/100k\": null}]}}, {\"mode\": \"vega-lite\"});\n",
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
"</script>"
],
"text/plain": [
"alt.LayerChart(...)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"<p style=\"font-size: smaller\">Data Sources: \n",
" <a href=\"https://covidtracking.com\">The COVID Tracking Project</a>\n",
"<br>\n",
"Analysis and Visualization:\n",
" <a href=\"https://renkulab.io/projects/covid-19/covid-19-public-data\">Covid-19 Public Data Collaboration Project</a>\n",
"</p>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"chart = alt.Chart(most_recent_df.sort_values('total/100k'), title=\"Cases per 100k\").encode(alt.X('state', sort=None))\n",
"tests = chart.mark_bar().encode(alt.Y('total/100k'))\n",
"positives = chart.mark_point(color='orange', filled=True, size=100, opacity=1).encode(alt.Y('positive/100k'))\n",
"display(alt.layer(tests, positives))\n",
"display(html_credits)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Counts and rates by state\n",
"\n",
"Taking a look at the three states with the highest per-capita incidence of covid-19. The red and yellow curves represent the total tests and total positive tests respectively. "
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div id=\"altair-viz-7042f7cd7ee54d7eaa3cbaa35fea58b4\"></div>\n",
"<script type=\"text/javascript\">\n",
" (function(spec, embedOpt){\n",
" const outputDiv = document.getElementById(\"altair-viz-7042f7cd7ee54d7eaa3cbaa35fea58b4\");\n",
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
" 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\": \"positive_diff\"}}, \"height\": 150, \"title\": \"NY\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Total/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"NY\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"orange\"}, \"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-80a4263d16dd445ba8458ce30f8be099\"}, \"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\": \"positive_diff\"}}, \"height\": 150, \"title\": \"WA\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Total/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"WA\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"orange\"}, \"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-05c72e45ccebb5c54e72cabc13978529\"}, \"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\": \"positive_diff\"}}, \"height\": 150, \"title\": \"NM\", \"width\": 250}, {\"layer\": [{\"mark\": {\"type\": \"line\", \"color\": \"red\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Total/10\"}, \"field\": \"total_10\"}}, \"height\": 150, \"title\": \"NM\", \"width\": 250}, {\"mark\": {\"type\": \"line\", \"color\": \"orange\"}, \"encoding\": {\"x\": {\"type\": \"temporal\", \"axis\": {\"title\": \"Date\"}, \"field\": \"date\"}, \"y\": {\"type\": \"quantitative\", \"axis\": {\"title\": \"Positive\"}, \"field\": \"positive\"}}, \"height\": 150, \"title\": \"NM\", \"width\": 250}]}], \"data\": {\"name\": \"data-62fd41fe50a92f25f5b6196ad3396d04\"}, \"resolve\": {\"scale\": {\"y\": \"independent\"}}}], \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.0.2.json\", \"datasets\": {\"data-80a4263d16dd445ba8458ce30f8be099\": [{\"state\": \"NY\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 30811.0, \"negative\": 72668.0, \"pending\": null, \"hospitalized\": 3805.0, \"death\": 285.0, \"total\": 103479, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 103479, \"deathIncrease\": 75.0, \"hospitalizedIncrease\": 571.0, \"negativeIncrease\": 7063.0, \"positiveIncrease\": 5146.0, \"totalTestResultsIncrease\": 12209.0, \"ratio\": 0.2977512345500053, \"positive_diff\": 5146.0, \"negative_diff\": 7063.0, \"death_diff\": 75.0, \"positive_diff_100k\": 26.452740451992312, \"death_diff_100k\": 0.38553352776902905, \"total_10\": 10347.9}, {\"state\": \"NY\", \"date\": \"2020-03-24T00:00:00\", \"positive\": 25665.0, \"negative\": 65605.0, \"pending\": null, \"hospitalized\": 3234.0, \"death\": 210.0, \"total\": 91270, \"dateChecked\": \"2020-03-24T20:00:00Z\", \"totalTestResults\": 91270, \"deathIncrease\": 96.0, \"hospitalizedIncrease\": 599.0, \"negativeIncrease\": 8191.0, \"positiveIncrease\": 4790.0, \"totalTestResultsIncrease\": 12981.0, \"ratio\": 0.2811986413936671, \"positive_diff\": 4790.0, \"negative_diff\": 8191.0, \"death_diff\": 96.0, \"positive_diff_100k\": 24.622741306848656, \"death_diff_100k\": 0.49348291554435714, \"total_10\": 9127.0}, {\"state\": \"NY\", \"date\": \"2020-03-23T00:00:00\", \"positive\": 20875.0, \"negative\": 57414.0, \"pending\": null, \"hospitalized\": 2635.0, \"death\": 114.0, \"total\": 78289, \"dateChecked\": \"2020-03-23T20:00:00Z\", \"totalTestResults\": 78289, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 661.0, \"negativeIncrease\": 11181.0, \"positiveIncrease\": 5707.0, \"totalTestResultsIncrease\": 16888.0, \"ratio\": 0.2666402687478445, \"positive_diff\": 5707.0, \"negative_diff\": 11181.0, \"death_diff\": 0.0, \"positive_diff_100k\": 29.336531239704644, \"death_diff_100k\": 0.0, \"total_10\": 7828.9}, {\"state\": \"NY\", \"date\": \"2020-03-22T00:00:00\", \"positive\": 15168.0, \"negative\": 46233.0, \"pending\": null, \"hospitalized\": 1974.0, \"death\": 114.0, \"total\": 61401, \"dateChecked\": \"2020-03-22T20:00:00Z\", \"totalTestResults\": 61401, \"deathIncrease\": 70.0, \"hospitalizedIncrease\": 371.0, \"negativeIncrease\": 11152.0, \"positiveIncrease\": 4812.0, \"totalTestResultsIncrease\": 15964.0, \"ratio\": 0.24703180729955537, \"positive_diff\": 4812.0, \"negative_diff\": 11152.0, \"death_diff\": 70.0, \"positive_diff_100k\": 24.735831141660903, \"death_diff_100k\": 0.3598312925844271, \"total_10\": 6140.1}, {\"state\": \"NY\", \"date\": \"2020-03-21T00:00:00\", \"positive\": 10356.0, \"negative\": 35081.0, \"pending\": null, \"hospitalized\": 1603.0, \"death\": 44.0, \"total\": 45437, \"dateChecked\": \"2020-03-21T20:00:00Z\", \"totalTestResults\": 45437, \"deathIncrease\": 9.0, \"hospitalizedIncrease\": 1603.0, \"negativeIncrease\": 9756.0, \"positiveIncrease\": 3254.0, \"totalTestResultsIncrease\": 13010.0, \"ratio\": 0.2279199771111649, \"positive_diff\": 3254.0, \"negative_diff\": 9756.0, \"death_diff\": 9.0, \"positive_diff_100k\": 16.72701465813894, \"death_diff_100k\": 0.04626402333228348, \"total_10\": 4543.7}, {\"state\": \"NY\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 7102.0, \"negative\": 25325.0, \"pending\": null, \"hospitalized\": null, \"death\": 35.0, \"total\": 32427, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"totalTestResults\": 32427, \"deathIncrease\": 23.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 7193.0, \"positiveIncrease\": 2950.0, \"totalTestResultsIncrease\": 10143.0, \"ratio\": 0.21901501834890677, \"positive_diff\": 2950.0, \"negative_diff\": 7193.0, \"death_diff\": 23.0, \"positive_diff_100k\": 15.16431875891514, \"death_diff_100k\": 0.11823028184916891, \"total_10\": 3242.7}, {\"state\": \"NY\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 4152.0, \"negative\": 18132.0, \"pending\": null, \"hospitalized\": null, \"death\": 12.0, \"total\": 22284, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"totalTestResults\": 22284, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 5917.0, \"positiveIncrease\": 1770.0, \"totalTestResultsIncrease\": 7687.0, \"ratio\": 0.18632202477113624, \"positive_diff\": 1770.0, \"negative_diff\": 5917.0, \"death_diff\": 0.0, \"positive_diff_100k\": 9.098591255349085, \"death_diff_100k\": 0.0, \"total_10\": 2228.4}, {\"state\": \"NY\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 2382.0, \"negative\": 12215.0, \"pending\": null, \"hospitalized\": null, \"death\": 12.0, \"total\": 14597, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"totalTestResults\": 14597, \"deathIncrease\": 5.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 6709.0, \"positiveIncrease\": 682.0, \"totalTestResultsIncrease\": 7391.0, \"ratio\": 0.1631842159347811, \"positive_diff\": 682.0, \"negative_diff\": 6709.0, \"death_diff\": 5.0, \"positive_diff_100k\": 3.505784879179704, \"death_diff_100k\": 0.02570223518460193, \"total_10\": 1459.7}, {\"state\": \"NY\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 1700.0, \"negative\": 5506.0, \"pending\": null, \"hospitalized\": null, \"death\": 7.0, \"total\": 7206, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"totalTestResults\": 7206, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 963.0, \"positiveIncrease\": 750.0, \"totalTestResultsIncrease\": 1713.0, \"ratio\": 0.23591451568137664, \"positive_diff\": 750.0, \"negative_diff\": 963.0, \"death_diff\": 0.0, \"positive_diff_100k\": 3.85533527769029, \"death_diff_100k\": 0.0, \"total_10\": 720.6}, {\"state\": \"NY\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 950.0, \"negative\": 4543.0, \"pending\": null, \"hospitalized\": null, \"death\": 7.0, \"total\": 5493, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"totalTestResults\": 5493, \"deathIncrease\": 4.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 221.0, \"totalTestResultsIncrease\": 221.0, \"ratio\": 0.17294738758419806, \"positive_diff\": 221.0, \"negative_diff\": 0.0, \"death_diff\": 4.0, \"positive_diff_100k\": 1.1360387951594055, \"death_diff_100k\": 0.020561788147681545, \"total_10\": 549.3}, {\"state\": \"NY\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 729.0, \"negative\": 4543.0, \"pending\": null, \"hospitalized\": null, \"death\": 3.0, \"total\": 5272, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"totalTestResults\": 5272, \"deathIncrease\": 3.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1764.0, \"positiveIncrease\": 205.0, \"totalTestResultsIncrease\": 1969.0, \"ratio\": 0.13827769347496208, \"positive_diff\": 205.0, \"negative_diff\": 1764.0, \"death_diff\": null, \"positive_diff_100k\": 1.0537916425686793, \"death_diff_100k\": null, \"total_10\": 527.2}, {\"state\": \"NY\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 524.0, \"negative\": 2779.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 3303, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"totalTestResults\": 3303, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 103.0, \"totalTestResultsIncrease\": 103.0, \"ratio\": 0.15864365728125945, \"positive_diff\": 103.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.5294660448027999, \"death_diff_100k\": null, \"total_10\": 330.3}, {\"state\": \"NY\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 421.0, \"negative\": 2779.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 3200, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"totalTestResults\": 3200, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2687.0, \"positiveIncrease\": 205.0, \"totalTestResultsIncrease\": 2892.0, \"ratio\": 0.1315625, \"positive_diff\": 205.0, \"negative_diff\": 2687.0, \"death_diff\": null, \"positive_diff_100k\": 1.0537916425686793, \"death_diff_100k\": null, \"total_10\": 320.0}, {\"state\": \"NY\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 216.0, \"negative\": 92.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 308, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"totalTestResults\": 308, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": 0.7012987012987013, \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 30.8}, {\"state\": \"NY\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 216.0, \"negative\": 92.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 308, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"totalTestResults\": 308, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 43.0, \"totalTestResultsIncrease\": 43.0, \"ratio\": 0.7012987012987013, \"positive_diff\": 43.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.22103922258757666, \"death_diff_100k\": null, \"total_10\": 30.8}, {\"state\": \"NY\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 173.0, \"negative\": 92.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 265, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"totalTestResults\": 265, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 31.0, \"totalTestResultsIncrease\": 31.0, \"ratio\": 0.6528301886792452, \"positive_diff\": 31.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.15935385814453198, \"death_diff_100k\": null, \"total_10\": 26.5}, {\"state\": \"NY\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 142.0, \"negative\": 92.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 234, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"totalTestResults\": 234, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 37.0, \"totalTestResultsIncrease\": 37.0, \"ratio\": 0.6068376068376068, \"positive_diff\": 37.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.19019654036605432, \"death_diff_100k\": null, \"total_10\": 23.4}, {\"state\": \"NY\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 105.0, \"negative\": 92.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 197, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"totalTestResults\": 197, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 29.0, \"totalTestResultsIncrease\": 29.0, \"ratio\": 0.5329949238578681, \"positive_diff\": 29.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.14907296407069123, \"death_diff_100k\": null, \"total_10\": 19.7}, {\"state\": \"NY\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 76.0, \"negative\": 92.0, \"pending\": 236.0, \"hospitalized\": null, \"death\": null, \"total\": 404, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"totalTestResults\": 168, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 43.0, \"totalTestResultsIncrease\": 43.0, \"ratio\": 0.18811881188118812, \"positive_diff\": 43.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.22103922258757666, \"death_diff_100k\": null, \"total_10\": 40.4}, {\"state\": \"NY\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 33.0, \"negative\": 92.0, \"pending\": 236.0, \"hospitalized\": null, \"death\": null, \"total\": 361, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"totalTestResults\": 125, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 16.0, \"positiveIncrease\": 11.0, \"totalTestResultsIncrease\": 27.0, \"ratio\": 0.09141274238227147, \"positive_diff\": 11.0, \"negative_diff\": 16.0, \"death_diff\": null, \"positive_diff_100k\": 0.05654491740612426, \"death_diff_100k\": null, \"total_10\": 36.1}, {\"state\": \"NY\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 22.0, \"negative\": 76.0, \"pending\": 24.0, \"hospitalized\": null, \"death\": null, \"total\": 122, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"totalTestResults\": 98, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 28.0, \"positiveIncrease\": 16.0, \"totalTestResultsIncrease\": 44.0, \"ratio\": 0.18032786885245902, \"positive_diff\": 16.0, \"negative_diff\": 28.0, \"death_diff\": null, \"positive_diff_100k\": 0.08224715259072618, \"death_diff_100k\": null, \"total_10\": 12.2}, {\"state\": \"NY\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 6.0, \"negative\": 48.0, \"pending\": 24.0, \"hospitalized\": null, \"death\": null, \"total\": 78, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"totalTestResults\": 54, \"deathIncrease\": null, \"hospitalizedIncrease\": null, \"negativeIncrease\": null, \"positiveIncrease\": null, \"totalTestResultsIncrease\": null, \"ratio\": 0.07692307692307693, \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"positive_diff_100k\": null, \"death_diff_100k\": null, \"total_10\": 7.8}], \"data-05c72e45ccebb5c54e72cabc13978529\": [{\"state\": \"WA\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 2469.0, \"negative\": 31712.0, \"pending\": null, \"hospitalized\": null, \"death\": 123.0, \"total\": 34181, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 34181, \"deathIncrease\": 13.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 248.0, \"totalTestResultsIncrease\": 248.0, \"ratio\": 0.07223311196278634, \"positive_diff\": 248.0, \"negative_diff\": 0.0, \"death_diff\": 13.0, \"positive_diff_100k\": 3.2567758995431713, \"death_diff_100k\": 0.1707180915083114, \"total_10\": 3418.1}, {\"state\": \"WA\", \"date\": \"2020-03-24T00:00:00\", \"positive\": 2221.0, \"negative\": 31712.0, \"pending\": null, \"hospitalized\": null, \"death\": 110.0, \"total\": 33933, \"dateChecked\": \"2020-03-24T20:00:00Z\", \"totalTestResults\": 33933, \"deathIncrease\": 15.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2833.0, \"positiveIncrease\": 225.0, \"totalTestResultsIncrease\": 3058.0, \"ratio\": 0.06545250935667345, \"positive_diff\": 225.0, \"negative_diff\": 2833.0, \"death_diff\": 15.0, \"positive_diff_100k\": 2.954736199182313, \"death_diff_100k\": 0.19698241327882088, \"total_10\": 3393.3}, {\"state\": \"WA\", \"date\": \"2020-03-23T00:00:00\", \"positive\": 1996.0, \"negative\": 28879.0, \"pending\": null, \"hospitalized\": null, \"death\": 95.0, \"total\": 30875, \"dateChecked\": \"2020-03-23T20:00:00Z\", \"totalTestResults\": 30875, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 3551.0, \"positiveIncrease\": 203.0, \"totalTestResultsIncrease\": 3754.0, \"ratio\": 0.06464777327935223, \"positive_diff\": 203.0, \"negative_diff\": 3551.0, \"death_diff\": 1.0, \"positive_diff_100k\": 2.665828659706709, \"death_diff_100k\": 0.013132160885254724, \"total_10\": 3087.5}, {\"state\": \"WA\", \"date\": \"2020-03-22T00:00:00\", \"positive\": 1793.0, \"negative\": 25328.0, \"pending\": null, \"hospitalized\": null, \"death\": 94.0, \"total\": 27121, \"dateChecked\": \"2020-03-22T20:00:00Z\", \"totalTestResults\": 27121, \"deathIncrease\": 11.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 3609.0, \"positiveIncrease\": 269.0, \"totalTestResultsIncrease\": 3878.0, \"ratio\": 0.06611113159544264, \"positive_diff\": 269.0, \"negative_diff\": 3609.0, \"death_diff\": 11.0, \"positive_diff_100k\": 3.532551278133521, \"death_diff_100k\": 0.14445376973780194, \"total_10\": 2712.1}, {\"state\": \"WA\", \"date\": \"2020-03-21T00:00:00\", \"positive\": 1524.0, \"negative\": 21719.0, \"pending\": null, \"hospitalized\": null, \"death\": 83.0, \"total\": 23243, \"dateChecked\": \"2020-03-21T20:00:00Z\", \"totalTestResults\": 23243, \"deathIncrease\": 9.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2383.0, \"positiveIncrease\": 148.0, \"totalTestResultsIncrease\": 2531.0, \"ratio\": 0.06556812803854924, \"positive_diff\": 148.0, \"negative_diff\": 2383.0, \"death_diff\": 9.0, \"positive_diff_100k\": 1.9435598110176993, \"death_diff_100k\": 0.11818944796729251, \"total_10\": 2324.3}, {\"state\": \"WA\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 1376.0, \"negative\": 19336.0, \"pending\": null, \"hospitalized\": null, \"death\": 74.0, \"total\": 20712, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"totalTestResults\": 20712, \"deathIncrease\": 8.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 3418.0, \"positiveIncrease\": 189.0, \"totalTestResultsIncrease\": 3607.0, \"ratio\": 0.0664349169563538, \"positive_diff\": 189.0, \"negative_diff\": 3418.0, \"death_diff\": 8.0, \"positive_diff_100k\": 2.4819784073131426, \"death_diff_100k\": 0.10505728708203779, \"total_10\": 2071.2}, {\"state\": \"WA\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 1187.0, \"negative\": 15918.0, \"pending\": null, \"hospitalized\": null, \"death\": 66.0, \"total\": 17105, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"totalTestResults\": 17105, \"deathIncrease\": 14.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2801.0, \"positiveIncrease\": 175.0, \"totalTestResultsIncrease\": 2976.0, \"ratio\": 0.06939491376790412, \"positive_diff\": 175.0, \"negative_diff\": 2801.0, \"death_diff\": 14.0, \"positive_diff_100k\": 2.298128154919577, \"death_diff_100k\": 0.18385025239356614, \"total_10\": 1710.5}, {\"state\": \"WA\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 1012.0, \"negative\": 13117.0, \"pending\": null, \"hospitalized\": null, \"death\": 52.0, \"total\": 14129, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"totalTestResults\": 14129, \"deathIncrease\": 4.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1535.0, \"positiveIncrease\": 108.0, \"totalTestResultsIncrease\": 1643.0, \"ratio\": 0.07162573430532947, \"positive_diff\": 108.0, \"negative_diff\": 1535.0, \"death_diff\": 4.0, \"positive_diff_100k\": 1.41827337560751, \"death_diff_100k\": 0.052528643541018896, \"total_10\": 1412.9}, {\"state\": \"WA\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 904.0, \"negative\": 11582.0, \"pending\": null, \"hospitalized\": null, \"death\": 48.0, \"total\": 12486, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"totalTestResults\": 12486, \"deathIncrease\": 6.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2131.0, \"positiveIncrease\": 135.0, \"totalTestResultsIncrease\": 2266.0, \"ratio\": 0.07240108921992632, \"positive_diff\": 135.0, \"negative_diff\": 2131.0, \"death_diff\": 6.0, \"positive_diff_100k\": 1.7728417195093877, \"death_diff_100k\": 0.07879296531152834, \"total_10\": 1248.6}, {\"state\": \"WA\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 769.0, \"negative\": 9451.0, \"pending\": null, \"hospitalized\": null, \"death\": 42.0, \"total\": 10220, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"totalTestResults\": 10220, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 2329.0, \"positiveIncrease\": 127.0, \"totalTestResultsIncrease\": 2456.0, \"ratio\": 0.07524461839530333, \"positive_diff\": 127.0, \"negative_diff\": 2329.0, \"death_diff\": 2.0, \"positive_diff_100k\": 1.6677844324273499, \"death_diff_100k\": 0.026264321770509448, \"total_10\": 1022.0}, {\"state\": \"WA\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 642.0, \"negative\": 7122.0, \"pending\": null, \"hospitalized\": null, \"death\": 40.0, \"total\": 7764, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"totalTestResults\": 7764, \"deathIncrease\": 3.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1121.0, \"positiveIncrease\": 74.0, \"totalTestResultsIncrease\": 1195.0, \"ratio\": 0.08268933539412673, \"positive_diff\": 74.0, \"negative_diff\": 1121.0, \"death_diff\": 3.0, \"positive_diff_100k\": 0.9717799055088496, \"death_diff_100k\": 0.03939648265576417, \"total_10\": 776.4}, {\"state\": \"WA\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 568.0, \"negative\": 6001.0, \"pending\": null, \"hospitalized\": null, \"death\": 37.0, \"total\": 6569, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"totalTestResults\": 6569, \"deathIncrease\": 6.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1651.0, \"positiveIncrease\": 111.0, \"totalTestResultsIncrease\": 1762.0, \"ratio\": 0.08646673770741362, \"positive_diff\": 111.0, \"negative_diff\": 1651.0, \"death_diff\": 6.0, \"positive_diff_100k\": 1.4576698582632743, \"death_diff_100k\": 0.07879296531152834, \"total_10\": 656.9}, {\"state\": \"WA\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 457.0, \"negative\": 4350.0, \"pending\": null, \"hospitalized\": null, \"death\": 31.0, \"total\": 4807, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"totalTestResults\": 4807, \"deathIncrease\": 2.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1313.0, \"positiveIncrease\": 120.0, \"totalTestResultsIncrease\": 1433.0, \"ratio\": 0.0950696900353651, \"positive_diff\": 120.0, \"negative_diff\": 1313.0, \"death_diff\": 2.0, \"positive_diff_100k\": 1.575859306230567, \"death_diff_100k\": 0.026264321770509448, \"total_10\": 480.7}, {\"state\": \"WA\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 337.0, \"negative\": 3037.0, \"pending\": null, \"hospitalized\": null, \"death\": 29.0, \"total\": 3403, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"totalTestResults\": 3374, \"deathIncrease\": 5.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 862.0, \"positiveIncrease\": 70.0, \"totalTestResultsIncrease\": 932.0, \"ratio\": 0.09903026741110785, \"positive_diff\": 70.0, \"negative_diff\": 862.0, \"death_diff\": 5.0, \"positive_diff_100k\": 0.9192512619678306, \"death_diff_100k\": 0.06566080442627362, \"total_10\": 340.3}, {\"state\": \"WA\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 267.0, \"negative\": 2175.0, \"pending\": null, \"hospitalized\": null, \"death\": 24.0, \"total\": 2466, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"totalTestResults\": 2442, \"deathIncrease\": 24.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1065.0, \"positiveIncrease\": 105.0, \"totalTestResultsIncrease\": 1170.0, \"ratio\": 0.10827250608272507, \"positive_diff\": 105.0, \"negative_diff\": 1065.0, \"death_diff\": null, \"positive_diff_100k\": 1.3788768929517459, \"death_diff_100k\": null, \"total_10\": 246.6}, {\"state\": \"WA\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 162.0, \"negative\": 1110.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 1272, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"totalTestResults\": 1272, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 26.0, \"totalTestResultsIncrease\": 26.0, \"ratio\": 0.12735849056603774, \"positive_diff\": 26.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.3414361830166228, \"death_diff_100k\": null, \"total_10\": 127.2}, {\"state\": \"WA\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 136.0, \"negative\": 1110.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 1246, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"totalTestResults\": 1246, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 470.0, \"positiveIncrease\": 34.0, \"totalTestResultsIncrease\": 504.0, \"ratio\": 0.10914927768860354, \"positive_diff\": 34.0, \"negative_diff\": 470.0, \"death_diff\": null, \"positive_diff_100k\": 0.44649347009866064, \"death_diff_100k\": null, \"total_10\": 124.6}, {\"state\": \"WA\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 102.0, \"negative\": 640.0, \"pending\": 60.0, \"hospitalized\": null, \"death\": null, \"total\": 802, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"totalTestResults\": 742, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 270.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 270.0, \"ratio\": 0.12718204488778054, \"positive_diff\": 0.0, \"negative_diff\": 270.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 80.2}, {\"state\": \"WA\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 102.0, \"negative\": 370.0, \"pending\": 66.0, \"hospitalized\": null, \"death\": null, \"total\": 538, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"totalTestResults\": 472, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 23.0, \"totalTestResultsIncrease\": 23.0, \"ratio\": 0.1895910780669145, \"positive_diff\": 23.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.30203970036085864, \"death_diff_100k\": null, \"total_10\": 53.8}, {\"state\": \"WA\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 79.0, \"negative\": 370.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 449, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"totalTestResults\": 449, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 370.0, \"positiveIncrease\": 9.0, \"totalTestResultsIncrease\": 379.0, \"ratio\": 0.1759465478841871, \"positive_diff\": 9.0, \"negative_diff\": null, \"death_diff\": null, \"positive_diff_100k\": 0.11818944796729251, \"death_diff_100k\": null, \"total_10\": 44.9}, {\"state\": \"WA\", \"date\": \"2020-03-05T00:00:00\", \"positive\": 70.0, \"negative\": null, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 70, \"dateChecked\": \"2020-03-05T21:00:00Z\", \"totalTestResults\": 70, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 31.0, \"totalTestResultsIncrease\": 31.0, \"ratio\": 1.0, \"positive_diff\": 31.0, \"negative_diff\": null, \"death_diff\": null, \"positive_diff_100k\": 0.4070969874428964, \"death_diff_100k\": null, \"total_10\": 7.0}, {\"state\": \"WA\", \"date\": \"2020-03-04T00:00:00\", \"positive\": 39.0, \"negative\": null, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 39, \"dateChecked\": \"2020-03-04T21:00:00Z\", \"totalTestResults\": 39, \"deathIncrease\": null, \"hospitalizedIncrease\": null, \"negativeIncrease\": null, \"positiveIncrease\": null, \"totalTestResultsIncrease\": null, \"ratio\": 1.0, \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"positive_diff_100k\": null, \"death_diff_100k\": null, \"total_10\": 3.9}], \"data-62fd41fe50a92f25f5b6196ad3396d04\": [{\"state\": \"NM\", \"date\": \"2020-03-25T00:00:00\", \"positive\": 100.0, \"negative\": 6742.0, \"pending\": null, \"hospitalized\": null, \"death\": 1.0, \"total\": 6842, \"dateChecked\": \"2020-03-25T20:00:00Z\", \"totalTestResults\": 6842, \"deathIncrease\": 1.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 852.0, \"positiveIncrease\": 17.0, \"totalTestResultsIncrease\": 869.0, \"ratio\": 0.014615609470914937, \"positive_diff\": 17.0, \"negative_diff\": 852.0, \"death_diff\": null, \"positive_diff_100k\": 0.8107480390627942, \"death_diff_100k\": null, \"total_10\": 684.2}, {\"state\": \"NM\", \"date\": \"2020-03-24T00:00:00\", \"positive\": 83.0, \"negative\": 5890.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 5973, \"dateChecked\": \"2020-03-24T20:00:00Z\", \"totalTestResults\": 5973, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 569.0, \"positiveIncrease\": 18.0, \"totalTestResultsIncrease\": 587.0, \"ratio\": 0.013895864724594007, \"positive_diff\": 18.0, \"negative_diff\": 569.0, \"death_diff\": null, \"positive_diff_100k\": 0.8584391001841352, \"death_diff_100k\": null, \"total_10\": 597.3}, {\"state\": \"NM\", \"date\": \"2020-03-23T00:00:00\", \"positive\": 65.0, \"negative\": 5321.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 5386, \"dateChecked\": \"2020-03-23T20:00:00Z\", \"totalTestResults\": 5386, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 599.0, \"positiveIncrease\": 8.0, \"totalTestResultsIncrease\": 607.0, \"ratio\": 0.012068325287783142, \"positive_diff\": 8.0, \"negative_diff\": 599.0, \"death_diff\": null, \"positive_diff_100k\": 0.3815284889707268, \"death_diff_100k\": null, \"total_10\": 538.6}, {\"state\": \"NM\", \"date\": \"2020-03-22T00:00:00\", \"positive\": 57.0, \"negative\": 4722.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 4779, \"dateChecked\": \"2020-03-22T20:00:00Z\", \"totalTestResults\": 4779, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 951.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 951.0, \"ratio\": 0.011927181418706842, \"positive_diff\": 0.0, \"negative_diff\": 951.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 477.9}, {\"state\": \"NM\", \"date\": \"2020-03-21T00:00:00\", \"positive\": 57.0, \"negative\": 3771.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 3828, \"dateChecked\": \"2020-03-21T20:00:00Z\", \"totalTestResults\": 3828, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 14.0, \"totalTestResultsIncrease\": 14.0, \"ratio\": 0.014890282131661442, \"positive_diff\": 14.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.6676748556987718, \"death_diff_100k\": null, \"total_10\": 382.8}, {\"state\": \"NM\", \"date\": \"2020-03-20T00:00:00\", \"positive\": 43.0, \"negative\": 3771.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 3814, \"dateChecked\": \"2020-03-20T20:00:00Z\", \"totalTestResults\": 3814, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1009.0, \"positiveIncrease\": 8.0, \"totalTestResultsIncrease\": 1017.0, \"ratio\": 0.011274252753015208, \"positive_diff\": 8.0, \"negative_diff\": 1009.0, \"death_diff\": null, \"positive_diff_100k\": 0.3815284889707268, \"death_diff_100k\": null, \"total_10\": 381.4}, {\"state\": \"NM\", \"date\": \"2020-03-19T00:00:00\", \"positive\": 35.0, \"negative\": 2762.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 2797, \"dateChecked\": \"2020-03-19T20:00:00Z\", \"totalTestResults\": 2797, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 436.0, \"positiveIncrease\": 7.0, \"totalTestResultsIncrease\": 443.0, \"ratio\": 0.012513407222023596, \"positive_diff\": 7.0, \"negative_diff\": 436.0, \"death_diff\": null, \"positive_diff_100k\": 0.3338374278493859, \"death_diff_100k\": null, \"total_10\": 279.7}, {\"state\": \"NM\", \"date\": \"2020-03-18T00:00:00\", \"positive\": 28.0, \"negative\": 2326.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 2354, \"dateChecked\": \"2020-03-18T20:00:00Z\", \"totalTestResults\": 2354, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 1077.0, \"positiveIncrease\": 5.0, \"totalTestResultsIncrease\": 1082.0, \"ratio\": 0.0118946474086661, \"positive_diff\": 5.0, \"negative_diff\": 1077.0, \"death_diff\": null, \"positive_diff_100k\": 0.23845530560670422, \"death_diff_100k\": null, \"total_10\": 235.4}, {\"state\": \"NM\", \"date\": \"2020-03-17T00:00:00\", \"positive\": 23.0, \"negative\": 1249.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 1272, \"dateChecked\": \"2020-03-17T20:00:00Z\", \"totalTestResults\": 1272, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 683.0, \"positiveIncrease\": 6.0, \"totalTestResultsIncrease\": 689.0, \"ratio\": 0.018081761006289308, \"positive_diff\": 6.0, \"negative_diff\": 683.0, \"death_diff\": null, \"positive_diff_100k\": 0.28614636672804505, \"death_diff_100k\": null, \"total_10\": 127.2}, {\"state\": \"NM\", \"date\": \"2020-03-16T00:00:00\", \"positive\": 17.0, \"negative\": 566.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 583, \"dateChecked\": \"2020-03-16T20:00:00Z\", \"totalTestResults\": 583, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 84.0, \"positiveIncrease\": 4.0, \"totalTestResultsIncrease\": 88.0, \"ratio\": 0.029159519725557463, \"positive_diff\": 4.0, \"negative_diff\": 84.0, \"death_diff\": null, \"positive_diff_100k\": 0.1907642444853634, \"death_diff_100k\": null, \"total_10\": 58.3}, {\"state\": \"NM\", \"date\": \"2020-03-15T00:00:00\", \"positive\": 13.0, \"negative\": 482.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 495, \"dateChecked\": \"2020-03-15T20:00:00Z\", \"totalTestResults\": 495, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 245.0, \"positiveIncrease\": 3.0, \"totalTestResultsIncrease\": 248.0, \"ratio\": 0.026262626262626262, \"positive_diff\": 3.0, \"negative_diff\": 245.0, \"death_diff\": null, \"positive_diff_100k\": 0.14307318336402253, \"death_diff_100k\": null, \"total_10\": 49.5}, {\"state\": \"NM\", \"date\": \"2020-03-14T00:00:00\", \"positive\": 10.0, \"negative\": 237.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 247, \"dateChecked\": \"2020-03-14T20:00:00Z\", \"totalTestResults\": 247, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 47.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 47.0, \"ratio\": 0.04048582995951417, \"positive_diff\": 0.0, \"negative_diff\": 47.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 24.7}, {\"state\": \"NM\", \"date\": \"2020-03-13T00:00:00\", \"positive\": 10.0, \"negative\": 190.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 200, \"dateChecked\": \"2020-03-13T20:00:00Z\", \"totalTestResults\": 200, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 35.0, \"positiveIncrease\": 5.0, \"totalTestResultsIncrease\": 40.0, \"ratio\": 0.05, \"positive_diff\": 5.0, \"negative_diff\": 35.0, \"death_diff\": null, \"positive_diff_100k\": 0.23845530560670422, \"death_diff_100k\": null, \"total_10\": 20.0}, {\"state\": \"NM\", \"date\": \"2020-03-12T00:00:00\", \"positive\": 5.0, \"negative\": 155.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 160, \"dateChecked\": \"2020-03-12T20:00:00Z\", \"totalTestResults\": 160, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 68.0, \"positiveIncrease\": 2.0, \"totalTestResultsIncrease\": 70.0, \"ratio\": 0.03125, \"positive_diff\": 2.0, \"negative_diff\": 68.0, \"death_diff\": null, \"positive_diff_100k\": 0.0953821222426817, \"death_diff_100k\": null, \"total_10\": 16.0}, {\"state\": \"NM\", \"date\": \"2020-03-11T00:00:00\", \"positive\": 3.0, \"negative\": 87.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 90, \"dateChecked\": \"2020-03-11T20:00:00Z\", \"totalTestResults\": 90, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 18.0, \"positiveIncrease\": 3.0, \"totalTestResultsIncrease\": 21.0, \"ratio\": 0.03333333333333333, \"positive_diff\": 3.0, \"negative_diff\": 18.0, \"death_diff\": null, \"positive_diff_100k\": 0.14307318336402253, \"death_diff_100k\": null, \"total_10\": 9.0}, {\"state\": \"NM\", \"date\": \"2020-03-10T00:00:00\", \"positive\": 0.0, \"negative\": 69.0, \"pending\": null, \"hospitalized\": null, \"death\": null, \"total\": 69, \"dateChecked\": \"2020-03-10T20:00:00Z\", \"totalTestResults\": 69, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 12.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 12.0, \"ratio\": 0.0, \"positive_diff\": 0.0, \"negative_diff\": 12.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 6.9}, {\"state\": \"NM\", \"date\": \"2020-03-09T00:00:00\", \"positive\": 0.0, \"negative\": 57.0, \"pending\": 0.0, \"hospitalized\": null, \"death\": null, \"total\": 57, \"dateChecked\": \"2020-03-09T20:00:00Z\", \"totalTestResults\": 57, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 9.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 9.0, \"ratio\": 0.0, \"positive_diff\": 0.0, \"negative_diff\": 9.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 5.7}, {\"state\": \"NM\", \"date\": \"2020-03-08T00:00:00\", \"positive\": 0.0, \"negative\": 48.0, \"pending\": 0.0, \"hospitalized\": null, \"death\": null, \"total\": 48, \"dateChecked\": \"2020-03-08T20:00:00Z\", \"totalTestResults\": 48, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 0.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 0.0, \"ratio\": 0.0, \"positive_diff\": 0.0, \"negative_diff\": 0.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 4.8}, {\"state\": \"NM\", \"date\": \"2020-03-07T00:00:00\", \"positive\": 0.0, \"negative\": 48.0, \"pending\": 0.0, \"hospitalized\": null, \"death\": null, \"total\": 48, \"dateChecked\": \"2020-03-07T21:00:00Z\", \"totalTestResults\": 48, \"deathIncrease\": 0.0, \"hospitalizedIncrease\": 0.0, \"negativeIncrease\": 32.0, \"positiveIncrease\": 0.0, \"totalTestResultsIncrease\": 32.0, \"ratio\": 0.0, \"positive_diff\": 0.0, \"negative_diff\": 32.0, \"death_diff\": null, \"positive_diff_100k\": 0.0, \"death_diff_100k\": null, \"total_10\": 4.8}, {\"state\": \"NM\", \"date\": \"2020-03-06T00:00:00\", \"positive\": 0.0, \"negative\": 16.0, \"pending\": 0.0, \"hospitalized\": null, \"death\": null, \"total\": 16, \"dateChecked\": \"2020-03-06T21:00:00Z\", \"totalTestResults\": 16, \"deathIncrease\": null, \"hospitalizedIncrease\": null, \"negativeIncrease\": null, \"positiveIncrease\": null, \"totalTestResultsIncrease\": null, \"ratio\": 0.0, \"positive_diff\": null, \"negative_diff\": null, \"death_diff\": null, \"positive_diff_100k\": null, \"death_diff_100k\": null, \"total_10\": 1.6}]}}, {\"mode\": \"vega-lite\"});\n",
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
"</script>"
],
"text/plain": [
"alt.HConcatChart(...)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"<p style=\"font-size: smaller\">Data Sources: \n",
" <a href=\"https://covidtracking.com\">The COVID Tracking Project</a>\n",
"<br>\n",
"Analysis and Visualization:\n",
" <a href=\"https://renkulab.io/projects/covid-19/covid-19-public-data\">Covid-19 Public Data Collaboration Project</a>\n",
"</p>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# produce the charts for a few states\n",
"\n",
"charts=[]\n",
"for state in ['NY', 'WA', 'NM']: \n",
" state_df = tdf_diff[tdf_diff['state'] == state].copy()\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('positive_diff', axis=alt.Axis(title='Daily positive')))\n",
"\n",
" totals = base.mark_line(color='red').encode(alt.Y('total_10', axis=alt.Axis(title='Total/10'))) \n",
" positives = totals.mark_line(color='orange').encode(alt.Y('positive', axis=alt.Axis(title='Positive')))\n",
" cumulative = totals + positives\n",
"\n",
" ratio = base.mark_line(color='red').encode(alt.Y('ratio', axis=alt.Axis(title='Positive/Total'), scale=alt.Scale(domain=(0,1))))\n",
" \n",
" charts.append(alt.layer(dailies, cumulative).resolve_scale(y='independent'))\n",
"\n",
"display(alt.hconcat(*charts))\n",
"display(html_credits)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"hide_input": true,
"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
}