{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Last Update=%{x}
Confirmed=%{y}", "legendgroup": "", "line": { "color": "#636efa", "dash": "solid" }, "mode": "lines", "name": "", "showlegend": false, "type": "scatter", "x": [ "2020-03-11T02:18:14", "2020-03-12T02:13:04", "2020-03-13T11:09:03", "2020-03-13T22:22:02", "2020-03-13T22:22:03", "2020-03-14T01:53:03", "2020-03-14T02:33:04", "2020-03-14T08:33:03", "2020-03-14T09:53:08", "2020-03-14T13:33:04", "2020-03-14T16:33:03", "2020-03-15T01:53:02", "2020-03-15T03:53:04", "2020-03-15T06:41:54", "2020-03-15T18:20:18", "2020-03-15T18:20:19", "2020-03-16T00:22:10", "2020-03-16T00:22:11", "2020-03-16T03:33:03", "2020-03-16T14:38:45", "2020-03-16T14:38:46", "2020-03-16T16:53:06", "2020-03-16T23:53:02", "2020-03-17T04:32:19", "2020-03-17T10:53:03", "2020-03-17T11:53:10", "2020-03-17T16:13:14", "2020-03-17T17:53:03", "2020-03-17T18:33:03", "2020-03-17T21:33:03", "2020-03-17T23:33:02", "2020-03-18T00:13:13", "2020-03-18T00:33:02", "2020-03-18T00:53:02", "2020-03-18T00:53:03", "2020-03-18T01:53:03", "2020-03-18T02:13:06", "2020-03-18T02:53:03", "2020-03-18T03:13:22", "2020-03-18T03:53:02", "2020-03-18T10:33:04", "2020-03-18T11:33:04", "2020-03-18T11:53:04", "2020-03-18T12:13:09", "2020-03-18T12:33:03", "2020-03-18T13:33:12", "2020-03-18T14:13:56", "2020-03-18T14:33:15", "2020-03-18T18:33:03", "2020-03-18T19:14:33", "2020-03-18T19:33:03", "2020-03-19T01:02:56", "2020-03-19T01:03:02", "2020-03-19T01:03:40", "2020-03-19T01:03:45", "2020-03-19T01:03:46", "2020-03-19T01:03:51", "2020-03-19T01:13:06", "2020-03-19T01:53:06", "2020-03-19T02:13:17", "2020-03-19T02:33:08", "2020-03-19T02:33:09", "2020-03-19T02:53:32", "2020-03-19T02:53:33", "2020-03-19T03:13:26", "2020-03-19T04:33:18", "2020-03-19T05:13:10", "2020-03-19T06:53:03", "2020-03-19T08:13:19", "2020-03-19T08:33:08", "2020-03-19T08:53:03", "2020-03-19T09:33:04", "2020-03-19T09:53:20", "2020-03-19T10:13:14", "2020-03-19T10:13:15", "2020-03-19T10:13:16", "2020-03-19T10:13:23", "2020-03-19T10:53:03", "2020-03-19T11:13:17", "2020-03-19T11:13:18", "2020-03-19T11:13:24", "2020-03-19T11:13:33", "2020-03-19T11:13:54", "2020-03-19T11:33:29", "2020-03-19T11:33:30", "2020-03-19T11:33:36", "2020-03-19T11:33:39", "2020-03-19T12:13:38", "2020-03-19T14:33:08", "2020-03-19T14:53:05", "2020-03-19T14:53:06", "2020-03-19T15:13:27", "2020-03-19T16:13:36", "2020-03-19T16:13:38", "2020-03-19T16:43:03", "2020-03-19T16:43:04", "2020-03-19T17:13:14", "2020-03-19T17:13:24", "2020-03-19T17:13:27", "2020-03-19T17:13:42", "2020-03-19T17:43:03", "2020-03-19T17:43:04", "2020-03-19T18:13:20", "2020-03-19T18:13:29", "2020-03-19T18:43:03", "2020-03-19T19:13:18", "2020-03-19T20:13:08", "2020-03-19T20:13:28", "2020-03-19T20:13:34", "2020-03-19T20:13:52", "2020-03-19T20:13:56", "2020-03-19T20:43:02", "2020-03-19T20:43:03", "2020-03-19T21:13:15", "2020-03-19T21:13:35", "2020-03-19T21:13:40", "2020-03-19T21:43:03", "2020-03-19T23:43:03", "2020-03-19T23:43:04" ], "xaxis": "x", "y": [ 1381, 935, 451, 3, 1, 1, 0, 1018, 1273, 1, 2, 631, 576, 2, 13, 3, 93, 5, 1, 253, 11, 47, 176, 2, 7, 22, 0, 3, 0, 0, 11, 2, 253, 2, 1, 146, 125, 122, 2, 246, 712, 96, 46, 123, 8, 238, 3, 0, 11, 28, 11, 1624, 75, 53, 16, 9, 16, 1378, 2, 8936, 187, 109, 116, 2, 367, 18, 480, 108, 2, 1, 3, 51, 208, 69573, 1824, 583, 148, 967, 1795, 753, 217, 75, 559, 19281, 150, 12, 3, 0, 134, 2013, 2463, 2224, 1398, 15, 545, 257, 1945, 83, 2689, 1151, 41035, 121, 694, 826, 857, 23, 34197, 355, 367, 13, 17, 12956, 25, 4075, 1081, 1528, 562, 137, 10129 ], "yaxis": "y" } ], "layout": { "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#f2f5fa" }, "error_y": { "color": "#f2f5fa" }, "marker": { "line": { "color": "rgb(17,17,17)", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "rgb(17,17,17)", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#A2B1C6", "gridcolor": "#506784", "linecolor": "#506784", "minorgridcolor": "#506784", "startlinecolor": "#A2B1C6" }, "baxis": { "endlinecolor": "#A2B1C6", "gridcolor": "#506784", "linecolor": "#506784", "minorgridcolor": "#506784", "startlinecolor": "#A2B1C6" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "line": { "color": "#283442" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "line": { "color": "#283442" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#506784" }, "line": { "color": "rgb(17,17,17)" } }, "header": { "fill": { "color": "#2a3f5f" }, "line": { "color": "rgb(17,17,17)" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#f2f5fa", "arrowhead": 0, "arrowwidth": 1 }, "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#f2f5fa" }, "geo": { "bgcolor": "rgb(17,17,17)", "lakecolor": "rgb(17,17,17)", "landcolor": "rgb(17,17,17)", "showlakes": true, "showland": true, "subunitcolor": "#506784" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "dark" }, "paper_bgcolor": "rgb(17,17,17)", "plot_bgcolor": "rgb(17,17,17)", "polar": { "angularaxis": { "gridcolor": "#506784", "linecolor": "#506784", "ticks": "" }, "bgcolor": "rgb(17,17,17)", "radialaxis": { "gridcolor": "#506784", "linecolor": "#506784", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "rgb(17,17,17)", "gridcolor": "#506784", "gridwidth": 2, "linecolor": "#506784", "showbackground": true, "ticks": "", "zerolinecolor": "#C8D4E3" }, "yaxis": { "backgroundcolor": "rgb(17,17,17)", "gridcolor": "#506784", "gridwidth": 2, "linecolor": "#506784", "showbackground": true, "ticks": "", "zerolinecolor": "#C8D4E3" }, "zaxis": { "backgroundcolor": "rgb(17,17,17)", "gridcolor": "#506784", "gridwidth": 2, "linecolor": "#506784", "showbackground": true, "ticks": "", "zerolinecolor": "#C8D4E3" } }, "shapedefaults": { "line": { "color": "#f2f5fa" } }, "sliderdefaults": { "bgcolor": "#C8D4E3", "bordercolor": "rgb(17,17,17)", "borderwidth": 1, "tickwidth": 0 }, "ternary": { "aaxis": { "gridcolor": "#506784", "linecolor": "#506784", "ticks": "" }, "baxis": { "gridcolor": "#506784", "linecolor": "#506784", "ticks": "" }, "bgcolor": "rgb(17,17,17)", "caxis": { "gridcolor": "#506784", "linecolor": "#506784", "ticks": "" } }, "title": { "x": 0.05 }, "updatemenudefaults": { "bgcolor": "#506784", "borderwidth": 0 }, "xaxis": { "automargin": true, "gridcolor": "#283442", "linecolor": "#506784", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#283442", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "#283442", "linecolor": "#506784", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#283442", "zerolinewidth": 2 } } }, "title": { "text": "Worldwide Confirmed Novel Coronavirus(COVID-19) Cases Over Time" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "Last Update" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "Confirmed" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd\n", "import plotly.express as px\n", "import plotly.io as pio\n", "pio.templates.default = \"plotly_dark\"\n", " \n", "covid_data= pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/03-19-2020.csv')\n", "grouped = covid_data.groupby('Last Update')['Last Update', 'Confirmed', 'Deaths'].sum().reset_index()\n", "fig = px.line(grouped, x=\"Last Update\", y=\"Confirmed\",\n", " title=\"Worldwide Confirmed Novel Coronavirus(COVID-19) Cases Over Time\")\n", "fig.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.1" } }, "nbformat": 4, "nbformat_minor": 2 }