Skip to content

Instantly share code, notes, and snippets.

@lisphilar
Created July 21, 2023 16:29
Show Gist options
  • Save lisphilar/e25b5ac4d1ac9dcea0f383ead0a4957e to your computer and use it in GitHub Desktop.
Save lisphilar/e25b5ac4d1ac9dcea0f383ead0a4957e to your computer and use it in GitHub Desktop.
covsirphy_v3-0-0_Illinois_20230722.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyMyVOUTwB3wuUe5RGND2CAH",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/lisphilar/e25b5ac4d1ac9dcea0f383ead0a4957e/covsirphy_v3-0-0_illinois_20230722.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "5vWrhNmcPdzr"
},
"outputs": [],
"source": [
"!pip install covsirphy"
]
},
{
"cell_type": "code",
"source": [
"import covsirphy as cs\n",
"cs.__version__"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "s_aMIIksPkum",
"outputId": "4aa32c00-1ad5-4021-b5e8-b8ade8d66e6d"
},
"execution_count": 2,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'3.0.0'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 2
}
]
},
{
"cell_type": "code",
"source": [
"eng = cs.DataEngineer()\n",
"eng.download(country='USA', province='Illinois', databases=[\"japan\", \"covid19dh\"]);"
],
"metadata": {
"id": "SY3rzNPSPlUm"
},
"execution_count": 3,
"outputs": []
},
{
"cell_type": "code",
"source": [
"eng.clean()\n",
"eng.transform()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Url0Du6kPnek",
"outputId": "2d0ff435-3edd-4cf9-9a88-7fd2dc4595af"
},
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<covsirphy.engineering.engineer.DataEngineer at 0x78df15ada7d0>"
]
},
"metadata": {},
"execution_count": 4
}
]
},
{
"cell_type": "code",
"source": [
"actual_df, status, _ = eng.subset(geo=(\"USA\", \"Illinois\", \"Cook\"), variables=\"SIRF\", complement=True)\n",
"print(status)\n",
"actual_df.tail()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 290
},
"id": "CWn0WQbAPrEt",
"outputId": "ade42dd9-e91f-4b45-da5e-8c848ae3e9ce"
},
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"monotonic increasing complemented confirmed data and \n",
"monotonic increasing complemented fatal data and \n",
"fully complemented recovered data\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
" Susceptible Infected Recovered Fatal\n",
"Date \n",
"2023-05-06 3609077.0 0 1525272 15884\n",
"2023-05-07 3609077.0 0 1525272 15884\n",
"2023-05-08 3609077.0 0 1525272 15884\n",
"2023-05-09 3609077.0 0 1525272 15884\n",
"2023-05-10 3609077.0 0 1525272 15884"
],
"text/html": [
"\n",
"\n",
" <div id=\"df-9d35d6bd-600a-42ad-866f-61789cae26e6\">\n",
" <div class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Susceptible</th>\n",
" <th>Infected</th>\n",
" <th>Recovered</th>\n",
" <th>Fatal</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Date</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2023-05-06</th>\n",
" <td>3609077.0</td>\n",
" <td>0</td>\n",
" <td>1525272</td>\n",
" <td>15884</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-05-07</th>\n",
" <td>3609077.0</td>\n",
" <td>0</td>\n",
" <td>1525272</td>\n",
" <td>15884</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-05-08</th>\n",
" <td>3609077.0</td>\n",
" <td>0</td>\n",
" <td>1525272</td>\n",
" <td>15884</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-05-09</th>\n",
" <td>3609077.0</td>\n",
" <td>0</td>\n",
" <td>1525272</td>\n",
" <td>15884</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-05-10</th>\n",
" <td>3609077.0</td>\n",
" <td>0</td>\n",
" <td>1525272</td>\n",
" <td>15884</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-9d35d6bd-600a-42ad-866f-61789cae26e6')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
"\n",
"\n",
" <div id=\"df-5f1fb126-d6a4-4ae1-a371-446341b54e2f\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-5f1fb126-d6a4-4ae1-a371-446341b54e2f')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
" </div>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const containerElement = document.querySelector('#' + key);\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" }\n",
" </script>\n",
"\n",
" <script>\n",
"\n",
"function displayQuickchartButton(domScope) {\n",
" let quickchartButtonEl =\n",
" domScope.querySelector('#df-5f1fb126-d6a4-4ae1-a371-446341b54e2f button.colab-df-quickchart');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"}\n",
"\n",
" displayQuickchartButton(document);\n",
" </script>\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" flex-wrap:wrap;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-9d35d6bd-600a-42ad-866f-61789cae26e6 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-9d35d6bd-600a-42ad-866f-61789cae26e6');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 5
}
]
},
{
"cell_type": "code",
"source": [
"eng.all()[['Country', 'Province', 'City']].drop_duplicates()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 424
},
"id": "XDQtxn9sRNLR",
"outputId": "f3d863d8-c6a6-4138-f1ba-c1bfdbf245a7"
},
"execution_count": 9,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" Country Province City\n",
"0 United States Illinois Adams\n",
"1147 United States Illinois Alexander\n",
"2267 United States Illinois Bond\n",
"3405 United States Illinois Boone\n",
"4536 United States Illinois Brown\n",
"... ... ... ...\n",
"110002 United States Illinois Whiteside\n",
"111154 United States Illinois Will\n",
"112305 United States Illinois Williamson\n",
"113454 United States Illinois Winnebago\n",
"114606 United States Illinois Woodford\n",
"\n",
"[102 rows x 3 columns]"
],
"text/html": [
"\n",
"\n",
" <div id=\"df-44930441-ede6-4f81-a32b-4dcc7205935a\">\n",
" <div class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Country</th>\n",
" <th>Province</th>\n",
" <th>City</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Adams</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1147</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Alexander</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2267</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Bond</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3405</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Boone</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4536</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Brown</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>110002</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Whiteside</td>\n",
" </tr>\n",
" <tr>\n",
" <th>111154</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Will</td>\n",
" </tr>\n",
" <tr>\n",
" <th>112305</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Williamson</td>\n",
" </tr>\n",
" <tr>\n",
" <th>113454</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Winnebago</td>\n",
" </tr>\n",
" <tr>\n",
" <th>114606</th>\n",
" <td>United States</td>\n",
" <td>Illinois</td>\n",
" <td>Woodford</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>102 rows × 3 columns</p>\n",
"</div>\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-44930441-ede6-4f81-a32b-4dcc7205935a')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
"\n",
"\n",
" <div id=\"df-abdea2c1-fb88-4db9-90ed-9a14f03e3611\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-abdea2c1-fb88-4db9-90ed-9a14f03e3611')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
" </div>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const containerElement = document.querySelector('#' + key);\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" }\n",
" </script>\n",
"\n",
" <script>\n",
"\n",
"function displayQuickchartButton(domScope) {\n",
" let quickchartButtonEl =\n",
" domScope.querySelector('#df-abdea2c1-fb88-4db9-90ed-9a14f03e3611 button.colab-df-quickchart');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"}\n",
"\n",
" displayQuickchartButton(document);\n",
" </script>\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" flex-wrap:wrap;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-44930441-ede6-4f81-a32b-4dcc7205935a button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-44930441-ede6-4f81-a32b-4dcc7205935a');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 9
}
]
},
{
"cell_type": "code",
"source": [
"df = eng.all()\n",
"df.loc[df['City'] == 'Cook']"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 661
},
"id": "p3xlcSZgRQsp",
"outputId": "388f5c7e-0bff-4c1d-9d8b-c49950a2e2f8"
},
"execution_count": 11,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" ISO3 Province City Date Cancel_events Confirmed \\\n",
"16999 USA Illinois Cook 2020-01-24 0.0 1.0 \n",
"17000 USA Illinois Cook 2020-01-25 0.0 1.0 \n",
"17001 USA Illinois Cook 2020-01-26 0.0 1.0 \n",
"17002 USA Illinois Cook 2020-01-27 0.0 1.0 \n",
"17003 USA Illinois Cook 2020-01-28 0.0 1.0 \n",
"... ... ... ... ... ... ... \n",
"18197 USA Illinois Cook 2023-05-06 0.0 1541156.0 \n",
"18198 USA Illinois Cook 2023-05-07 0.0 1541156.0 \n",
"18199 USA Illinois Cook 2023-05-08 0.0 1541156.0 \n",
"18200 USA Illinois Cook 2023-05-09 0.0 1541156.0 \n",
"18201 USA Illinois Cook 2023-05-10 0.0 1541156.0 \n",
"\n",
" Contact_tracing Country Fatal Gatherings_restrictions ... \\\n",
"16999 1.0 United States 0.0 0.0 ... \n",
"17000 1.0 United States 0.0 0.0 ... \n",
"17001 1.0 United States 0.0 0.0 ... \n",
"17002 1.0 United States 0.0 0.0 ... \n",
"17003 1.0 United States 0.0 0.0 ... \n",
"... ... ... ... ... ... \n",
"18197 2.0 United States 15884.0 0.0 ... \n",
"18198 2.0 United States 15884.0 0.0 ... \n",
"18199 2.0 United States 15884.0 0.0 ... \n",
"18200 2.0 United States 15884.0 0.0 ... \n",
"18201 2.0 United States 15884.0 0.0 ... \n",
"\n",
" Population Recovered School_closing Stay_home_restrictions \\\n",
"16999 5150233.0 0.0 0.0 0.0 \n",
"17000 5150233.0 0.0 0.0 0.0 \n",
"17001 5150233.0 0.0 0.0 0.0 \n",
"17002 5150233.0 0.0 0.0 0.0 \n",
"17003 5150233.0 0.0 0.0 0.0 \n",
"... ... ... ... ... \n",
"18197 5150233.0 0.0 -2.0 0.0 \n",
"18198 5150233.0 0.0 -2.0 0.0 \n",
"18199 5150233.0 0.0 -2.0 0.0 \n",
"18200 5150233.0 0.0 -2.0 0.0 \n",
"18201 5150233.0 0.0 -2.0 0.0 \n",
"\n",
" Stringency_index Susceptible Testing_policy Tests \\\n",
"16999 -2.78 5150232.0 1.0 0.0 \n",
"17000 -2.78 5150232.0 1.0 0.0 \n",
"17001 -2.78 5150232.0 1.0 0.0 \n",
"17002 -2.78 5150232.0 1.0 0.0 \n",
"17003 -5.56 5150232.0 1.0 0.0 \n",
"... ... ... ... ... \n",
"18197 -33.33 3609077.0 3.0 0.0 \n",
"18198 -33.33 3609077.0 3.0 0.0 \n",
"18199 -33.33 3609077.0 3.0 0.0 \n",
"18200 -33.33 3609077.0 3.0 0.0 \n",
"18201 -33.33 3609077.0 3.0 0.0 \n",
"\n",
" Transport_closing Workplace_closing \n",
"16999 0.0 0.0 \n",
"17000 0.0 0.0 \n",
"17001 0.0 0.0 \n",
"17002 0.0 0.0 \n",
"17003 0.0 0.0 \n",
"... ... ... \n",
"18197 0.0 0.0 \n",
"18198 0.0 0.0 \n",
"18199 0.0 0.0 \n",
"18200 0.0 0.0 \n",
"18201 0.0 0.0 \n",
"\n",
"[1203 rows x 24 columns]"
],
"text/html": [
"\n",
"\n",
" <div id=\"df-2bb4b324-9a2c-445b-865e-3af66750bbb6\">\n",
" <div class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>ISO3</th>\n",
" <th>Province</th>\n",
" <th>City</th>\n",
" <th>Date</th>\n",
" <th>Cancel_events</th>\n",
" <th>Confirmed</th>\n",
" <th>Contact_tracing</th>\n",
" <th>Country</th>\n",
" <th>Fatal</th>\n",
" <th>Gatherings_restrictions</th>\n",
" <th>...</th>\n",
" <th>Population</th>\n",
" <th>Recovered</th>\n",
" <th>School_closing</th>\n",
" <th>Stay_home_restrictions</th>\n",
" <th>Stringency_index</th>\n",
" <th>Susceptible</th>\n",
" <th>Testing_policy</th>\n",
" <th>Tests</th>\n",
" <th>Transport_closing</th>\n",
" <th>Workplace_closing</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>16999</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2020-01-24</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>United States</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.78</td>\n",
" <td>5150232.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17000</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2020-01-25</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>United States</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.78</td>\n",
" <td>5150232.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17001</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2020-01-26</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>United States</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.78</td>\n",
" <td>5150232.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17002</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2020-01-27</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>United States</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.78</td>\n",
" <td>5150232.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17003</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2020-01-28</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>United States</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-5.56</td>\n",
" <td>5150232.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18197</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2023-05-06</td>\n",
" <td>0.0</td>\n",
" <td>1541156.0</td>\n",
" <td>2.0</td>\n",
" <td>United States</td>\n",
" <td>15884.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.0</td>\n",
" <td>0.0</td>\n",
" <td>-33.33</td>\n",
" <td>3609077.0</td>\n",
" <td>3.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18198</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2023-05-07</td>\n",
" <td>0.0</td>\n",
" <td>1541156.0</td>\n",
" <td>2.0</td>\n",
" <td>United States</td>\n",
" <td>15884.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.0</td>\n",
" <td>0.0</td>\n",
" <td>-33.33</td>\n",
" <td>3609077.0</td>\n",
" <td>3.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18199</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2023-05-08</td>\n",
" <td>0.0</td>\n",
" <td>1541156.0</td>\n",
" <td>2.0</td>\n",
" <td>United States</td>\n",
" <td>15884.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.0</td>\n",
" <td>0.0</td>\n",
" <td>-33.33</td>\n",
" <td>3609077.0</td>\n",
" <td>3.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18200</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2023-05-09</td>\n",
" <td>0.0</td>\n",
" <td>1541156.0</td>\n",
" <td>2.0</td>\n",
" <td>United States</td>\n",
" <td>15884.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.0</td>\n",
" <td>0.0</td>\n",
" <td>-33.33</td>\n",
" <td>3609077.0</td>\n",
" <td>3.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18201</th>\n",
" <td>USA</td>\n",
" <td>Illinois</td>\n",
" <td>Cook</td>\n",
" <td>2023-05-10</td>\n",
" <td>0.0</td>\n",
" <td>1541156.0</td>\n",
" <td>2.0</td>\n",
" <td>United States</td>\n",
" <td>15884.0</td>\n",
" <td>0.0</td>\n",
" <td>...</td>\n",
" <td>5150233.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.0</td>\n",
" <td>0.0</td>\n",
" <td>-33.33</td>\n",
" <td>3609077.0</td>\n",
" <td>3.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1203 rows × 24 columns</p>\n",
"</div>\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-2bb4b324-9a2c-445b-865e-3af66750bbb6')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
"\n",
"\n",
" <div id=\"df-d99128a4-6fdb-491c-af55-81189738dc26\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-d99128a4-6fdb-491c-af55-81189738dc26')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
" </div>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const containerElement = document.querySelector('#' + key);\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" }\n",
" </script>\n",
"\n",
" <script>\n",
"\n",
"function displayQuickchartButton(domScope) {\n",
" let quickchartButtonEl =\n",
" domScope.querySelector('#df-d99128a4-6fdb-491c-af55-81189738dc26 button.colab-df-quickchart');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"}\n",
"\n",
" displayQuickchartButton(document);\n",
" </script>\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" flex-wrap:wrap;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-2bb4b324-9a2c-445b-865e-3af66750bbb6 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-2bb4b324-9a2c-445b-865e-3af66750bbb6');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 11
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment