{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# COVID-19 Analysis\n", "
" ] }, { "cell_type": "code", "execution_count": 98, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
LatLong1/22/201/23/201/24/201/25/201/26/201/27/201/28/201/29/20...2/20/202/21/202/22/202/23/202/24/202/25/202/26/202/27/202/28/202/29/20
count119.000000119.000000119.000000119.000000119.000000119.000000119.000000119.000000119.000000119.000000...119.000000119.000000119.000000119.000000119.000000119.000000119.000000119.000000119.000000119.000000
mean32.19540640.1268874.6638665.4873957.90756312.05042017.79831924.59663946.87395051.815126...640.327731645.739496660.495798663.739496668.655462675.756303684.008403695.428571706.907563722.798319
std20.30552285.83969040.73171440.82327950.73393470.51371498.446628132.578235326.602349328.203946...5719.8096485739.8400775869.8722725869.7249785888.2201115933.8157575970.5245706008.3338666038.3859826079.237047
min-40.900600-123.8695000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000...0.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000
25%26.4471503.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000...0.0000000.0000000.0000000.0000000.0000001.0000001.0000001.0000001.0000001.000000
50%35.44370053.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000...2.0000002.0000002.0000002.0000002.0000002.0000003.0000004.0000004.0000007.000000
75%43.659650113.4872000.0000001.0000002.0000003.0000004.0000006.0000008.0000009.000000...80.00000080.50000080.50000090.00000090.00000092.00000093.00000093.00000093.500000101.000000
max64.963100174.886000444.000000444.000000549.000000761.0000001058.0000001423.0000003554.0000003554.000000...62442.00000062662.00000064084.00000064084.00000064287.00000064786.00000065187.00000065596.00000065914.00000066337.000000
\n", "

8 rows × 41 columns

\n", "
" ], "text/plain": [ " Lat Long 1/22/20 1/23/20 1/24/20 1/25/20 \\\n", "count 119.000000 119.000000 119.000000 119.000000 119.000000 119.000000 \n", "mean 32.195406 40.126887 4.663866 5.487395 7.907563 12.050420 \n", "std 20.305522 85.839690 40.731714 40.823279 50.733934 70.513714 \n", "min -40.900600 -123.869500 0.000000 0.000000 0.000000 0.000000 \n", "25% 26.447150 3.000000 0.000000 0.000000 0.000000 0.000000 \n", "50% 35.443700 53.000000 0.000000 0.000000 0.000000 0.000000 \n", "75% 43.659650 113.487200 0.000000 1.000000 2.000000 3.000000 \n", "max 64.963100 174.886000 444.000000 444.000000 549.000000 761.000000 \n", "\n", " 1/26/20 1/27/20 1/28/20 1/29/20 ... 2/20/20 \\\n", "count 119.000000 119.000000 119.000000 119.000000 ... 119.000000 \n", "mean 17.798319 24.596639 46.873950 51.815126 ... 640.327731 \n", "std 98.446628 132.578235 326.602349 328.203946 ... 5719.809648 \n", "min 0.000000 0.000000 0.000000 0.000000 ... 0.000000 \n", "25% 0.000000 0.000000 0.000000 0.000000 ... 0.000000 \n", "50% 0.000000 0.000000 0.000000 0.000000 ... 2.000000 \n", "75% 4.000000 6.000000 8.000000 9.000000 ... 80.000000 \n", "max 1058.000000 1423.000000 3554.000000 3554.000000 ... 62442.000000 \n", "\n", " 2/21/20 2/22/20 2/23/20 2/24/20 2/25/20 \\\n", "count 119.000000 119.000000 119.000000 119.000000 119.000000 \n", "mean 645.739496 660.495798 663.739496 668.655462 675.756303 \n", "std 5739.840077 5869.872272 5869.724978 5888.220111 5933.815757 \n", "min 0.000000 0.000000 0.000000 0.000000 0.000000 \n", "25% 0.000000 0.000000 0.000000 0.000000 1.000000 \n", "50% 2.000000 2.000000 2.000000 2.000000 2.000000 \n", "75% 80.500000 80.500000 90.000000 90.000000 92.000000 \n", "max 62662.000000 64084.000000 64084.000000 64287.000000 64786.000000 \n", "\n", " 2/26/20 2/27/20 2/28/20 2/29/20 \n", "count 119.000000 119.000000 119.000000 119.000000 \n", "mean 684.008403 695.428571 706.907563 722.798319 \n", "std 5970.524570 6008.333866 6038.385982 6079.237047 \n", "min 0.000000 0.000000 0.000000 0.000000 \n", "25% 1.000000 1.000000 1.000000 1.000000 \n", "50% 3.000000 4.000000 4.000000 7.000000 \n", "75% 93.000000 93.000000 93.500000 101.000000 \n", "max 65187.000000 65596.000000 65914.000000 66337.000000 \n", "\n", "[8 rows x 41 columns]" ] }, "execution_count": 98, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "data = pd.read_csv(\"https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv\")\n", "data.describe()" ] }, { "cell_type": "code", "execution_count": 99, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Province/StateCountry/RegionLatLong1/22/201/23/201/24/201/25/201/26/201/27/20...2/20/202/21/202/22/202/23/202/24/202/25/202/26/202/27/202/28/202/29/20
0AnhuiMainland China31.82570117.22641915396070...987988989989989989989989990990
1BeijingMainland China40.18240116.4142142236416880...395396399399399400400410410411
2ChongqingMainland China30.05720107.874069275775110...567572573575576576576576576576
3FujianMainland China26.07890117.98741510183559...293293293293293294294296296296
4GansuMainland China36.06110103.83430224714...91919191919191919191
5GuangdongMainland China23.34170113.424426325378111151...1332133313391342134513471347134713481349
6GuangxiMainland China23.82980108.78812523233646...245246249249251252252252252252
7GuizhouMainland China26.81540106.8748133457...146146146146146146146146146146
8HainanMainland China19.19590109.7453458192233...168168168168168168168168168168
9HebeiMainland China38.04280114.514911281318...307308309311311311312317318318
10HeilongjiangMainland China47.86200127.761502491521...476479479480480480480480480480
11HenanMainland China33.88202113.61405593283128...1265126712701271127112711271127212721272
12HubeiMainland China30.97560112.270744444454976110581423...62442626626408464084642876478665187655966591466337
13HunanMainland China27.61040111.708849244369100...1010101110131016101610161016101710171018
14Inner MongoliaMainland China44.09350113.94480017711...75757575757575757575
15JiangsuMainland China32.97110119.4550159183347...631631631631631631631631631631
16JiangxiMainland China27.61400115.72212718183672...934934934934934934934934935935
17JilinMainland China43.66610126.1923013446...91919191939393939393
18LiaoningMainland China41.29560122.6085234172127...121121121121121121121121121121
19NingxiaMainland China37.26920106.1655112347...71717171717171727273
20QinghaiMainland China35.7452095.9956000116...18181818181818181818
21ShaanxiMainland China35.19170108.8701035152235...245245245245245245245245245245
22ShandongMainland China36.34270118.14982615274675...546749750754755756756756756756
23ShanghaiMainland China31.20200121.449191620334053...334334335335335336337337337337
24ShanxiMainland China37.57770112.29221116913...132132132132133133133133133133
25SichuanMainland China30.61710102.71035815284469...520525526526527529531534538538
26TianjinMainland China39.30540117.3230448101423...131132135135135135135136136136
27TibetMainland China31.6927088.0924000000...1111111111
28XinjiangMainland China41.1129085.2401022345...76767676767676767676
29YunnanMainland China24.97400101.4870125111626...174174174174174174174174174174
..................................................................
89NaNAlgeria28.033901.6596000000...0000011111
90NaNCroatia45.1000015.2000000000...0000013356
91NaNSwitzerland46.818208.2275000000...00000118818
92NaNAustria47.5162014.5501000000...0000022339
93NaNIsrael31.0000035.0000000000...0111112347
94NaNPakistan30.3753069.3451000000...0000002224
95NaNBrazil-14.23500-51.9253000000...0000001112
96NaNGeorgia42.3154043.3569000000...0000001111
97NaNGreece39.0742021.8243000000...0000001344
98NaNNorth Macedonia41.6086021.7453000000...0000001111
99NaNNorway60.472008.4689000000...00000011615
100NaNRomania45.9432024.9668000000...0000001133
101NaNDenmark56.263909.5018000000...0000000113
102NaNEstonia58.5953025.0136000000...0000000111
103NaNNetherlands52.132605.2913000000...0000000116
104NaNSan Marino43.9424012.4578000000...0000000111
105NaNBelarus53.7098027.9534000000...0000000011
106Montreal, QCCanada45.50170-73.5673000000...0000000011
107NaNIceland64.96310-19.0208000000...0000000011
108NaNLithuania55.1694023.8813000000...0000000011
109NaNMexico23.63450-102.5528000000...0000000014
110NaNNew Zealand-40.90060174.8860000000...0000000011
111NaNNigeria9.082008.6753000000...0000000011
112Western AustraliaAustralia-31.95050115.8605000000...0000000002
113NaNIreland53.14240-7.6921000000...0000000001
114NaNLuxembourg49.815306.1296000000...0000000001
115NaNMonaco43.733307.4167000000...0000000001
116NaNQatar25.3548051.1839000000...0000000001
117Portland, ORUS45.50510-122.6750000000...0000000001
118Snohomish County, WAUS48.03300-121.8339000000...0000000001
\n", "

119 rows × 43 columns

\n", "
" ], "text/plain": [ " Province/State Country/Region Lat Long 1/22/20 \\\n", "0 Anhui Mainland China 31.82570 117.2264 1 \n", "1 Beijing Mainland China 40.18240 116.4142 14 \n", "2 Chongqing Mainland China 30.05720 107.8740 6 \n", "3 Fujian Mainland China 26.07890 117.9874 1 \n", "4 Gansu Mainland China 36.06110 103.8343 0 \n", "5 Guangdong Mainland China 23.34170 113.4244 26 \n", "6 Guangxi Mainland China 23.82980 108.7881 2 \n", "7 Guizhou Mainland China 26.81540 106.8748 1 \n", "8 Hainan Mainland China 19.19590 109.7453 4 \n", "9 Hebei Mainland China 38.04280 114.5149 1 \n", "10 Heilongjiang Mainland China 47.86200 127.7615 0 \n", "11 Henan Mainland China 33.88202 113.6140 5 \n", "12 Hubei Mainland China 30.97560 112.2707 444 \n", "13 Hunan Mainland China 27.61040 111.7088 4 \n", "14 Inner Mongolia Mainland China 44.09350 113.9448 0 \n", "15 Jiangsu Mainland China 32.97110 119.4550 1 \n", "16 Jiangxi Mainland China 27.61400 115.7221 2 \n", "17 Jilin Mainland China 43.66610 126.1923 0 \n", "18 Liaoning Mainland China 41.29560 122.6085 2 \n", "19 Ningxia Mainland China 37.26920 106.1655 1 \n", "20 Qinghai Mainland China 35.74520 95.9956 0 \n", "21 Shaanxi Mainland China 35.19170 108.8701 0 \n", "22 Shandong Mainland China 36.34270 118.1498 2 \n", "23 Shanghai Mainland China 31.20200 121.4491 9 \n", "24 Shanxi Mainland China 37.57770 112.2922 1 \n", "25 Sichuan Mainland China 30.61710 102.7103 5 \n", "26 Tianjin Mainland China 39.30540 117.3230 4 \n", "27 Tibet Mainland China 31.69270 88.0924 0 \n", "28 Xinjiang Mainland China 41.11290 85.2401 0 \n", "29 Yunnan Mainland China 24.97400 101.4870 1 \n", ".. ... ... ... ... ... \n", "89 NaN Algeria 28.03390 1.6596 0 \n", "90 NaN Croatia 45.10000 15.2000 0 \n", "91 NaN Switzerland 46.81820 8.2275 0 \n", "92 NaN Austria 47.51620 14.5501 0 \n", "93 NaN Israel 31.00000 35.0000 0 \n", "94 NaN Pakistan 30.37530 69.3451 0 \n", "95 NaN Brazil -14.23500 -51.9253 0 \n", "96 NaN Georgia 42.31540 43.3569 0 \n", "97 NaN Greece 39.07420 21.8243 0 \n", "98 NaN North Macedonia 41.60860 21.7453 0 \n", "99 NaN Norway 60.47200 8.4689 0 \n", "100 NaN Romania 45.94320 24.9668 0 \n", "101 NaN Denmark 56.26390 9.5018 0 \n", "102 NaN Estonia 58.59530 25.0136 0 \n", "103 NaN Netherlands 52.13260 5.2913 0 \n", "104 NaN San Marino 43.94240 12.4578 0 \n", "105 NaN Belarus 53.70980 27.9534 0 \n", "106 Montreal, QC Canada 45.50170 -73.5673 0 \n", "107 NaN Iceland 64.96310 -19.0208 0 \n", "108 NaN Lithuania 55.16940 23.8813 0 \n", "109 NaN Mexico 23.63450 -102.5528 0 \n", "110 NaN New Zealand -40.90060 174.8860 0 \n", "111 NaN Nigeria 9.08200 8.6753 0 \n", "112 Western Australia Australia -31.95050 115.8605 0 \n", "113 NaN Ireland 53.14240 -7.6921 0 \n", "114 NaN Luxembourg 49.81530 6.1296 0 \n", "115 NaN Monaco 43.73330 7.4167 0 \n", "116 NaN Qatar 25.35480 51.1839 0 \n", "117 Portland, OR US 45.50510 -122.6750 0 \n", "118 Snohomish County, WA US 48.03300 -121.8339 0 \n", "\n", " 1/23/20 1/24/20 1/25/20 1/26/20 1/27/20 ... 2/20/20 2/21/20 \\\n", "0 9 15 39 60 70 ... 987 988 \n", "1 22 36 41 68 80 ... 395 396 \n", "2 9 27 57 75 110 ... 567 572 \n", "3 5 10 18 35 59 ... 293 293 \n", "4 2 2 4 7 14 ... 91 91 \n", "5 32 53 78 111 151 ... 1332 1333 \n", "6 5 23 23 36 46 ... 245 246 \n", "7 3 3 4 5 7 ... 146 146 \n", "8 5 8 19 22 33 ... 168 168 \n", "9 1 2 8 13 18 ... 307 308 \n", "10 2 4 9 15 21 ... 476 479 \n", "11 5 9 32 83 128 ... 1265 1267 \n", "12 444 549 761 1058 1423 ... 62442 62662 \n", "13 9 24 43 69 100 ... 1010 1011 \n", "14 0 1 7 7 11 ... 75 75 \n", "15 5 9 18 33 47 ... 631 631 \n", "16 7 18 18 36 72 ... 934 934 \n", "17 1 3 4 4 6 ... 91 91 \n", "18 3 4 17 21 27 ... 121 121 \n", "19 1 2 3 4 7 ... 71 71 \n", "20 0 0 1 1 6 ... 18 18 \n", "21 3 5 15 22 35 ... 245 245 \n", "22 6 15 27 46 75 ... 546 749 \n", "23 16 20 33 40 53 ... 334 334 \n", "24 1 1 6 9 13 ... 132 132 \n", "25 8 15 28 44 69 ... 520 525 \n", "26 4 8 10 14 23 ... 131 132 \n", "27 0 0 0 0 0 ... 1 1 \n", "28 2 2 3 4 5 ... 76 76 \n", "29 2 5 11 16 26 ... 174 174 \n", ".. ... ... ... ... ... ... ... ... \n", "89 0 0 0 0 0 ... 0 0 \n", "90 0 0 0 0 0 ... 0 0 \n", "91 0 0 0 0 0 ... 0 0 \n", "92 0 0 0 0 0 ... 0 0 \n", "93 0 0 0 0 0 ... 0 1 \n", "94 0 0 0 0 0 ... 0 0 \n", "95 0 0 0 0 0 ... 0 0 \n", "96 0 0 0 0 0 ... 0 0 \n", "97 0 0 0 0 0 ... 0 0 \n", "98 0 0 0 0 0 ... 0 0 \n", "99 0 0 0 0 0 ... 0 0 \n", "100 0 0 0 0 0 ... 0 0 \n", "101 0 0 0 0 0 ... 0 0 \n", "102 0 0 0 0 0 ... 0 0 \n", "103 0 0 0 0 0 ... 0 0 \n", "104 0 0 0 0 0 ... 0 0 \n", "105 0 0 0 0 0 ... 0 0 \n", "106 0 0 0 0 0 ... 0 0 \n", "107 0 0 0 0 0 ... 0 0 \n", "108 0 0 0 0 0 ... 0 0 \n", "109 0 0 0 0 0 ... 0 0 \n", "110 0 0 0 0 0 ... 0 0 \n", "111 0 0 0 0 0 ... 0 0 \n", "112 0 0 0 0 0 ... 0 0 \n", "113 0 0 0 0 0 ... 0 0 \n", "114 0 0 0 0 0 ... 0 0 \n", "115 0 0 0 0 0 ... 0 0 \n", "116 0 0 0 0 0 ... 0 0 \n", "117 0 0 0 0 0 ... 0 0 \n", "118 0 0 0 0 0 ... 0 0 \n", "\n", " 2/22/20 2/23/20 2/24/20 2/25/20 2/26/20 2/27/20 2/28/20 2/29/20 \n", "0 989 989 989 989 989 989 990 990 \n", "1 399 399 399 400 400 410 410 411 \n", "2 573 575 576 576 576 576 576 576 \n", "3 293 293 293 294 294 296 296 296 \n", "4 91 91 91 91 91 91 91 91 \n", "5 1339 1342 1345 1347 1347 1347 1348 1349 \n", "6 249 249 251 252 252 252 252 252 \n", "7 146 146 146 146 146 146 146 146 \n", "8 168 168 168 168 168 168 168 168 \n", "9 309 311 311 311 312 317 318 318 \n", "10 479 480 480 480 480 480 480 480 \n", "11 1270 1271 1271 1271 1271 1272 1272 1272 \n", "12 64084 64084 64287 64786 65187 65596 65914 66337 \n", "13 1013 1016 1016 1016 1016 1017 1017 1018 \n", "14 75 75 75 75 75 75 75 75 \n", "15 631 631 631 631 631 631 631 631 \n", "16 934 934 934 934 934 934 935 935 \n", "17 91 91 93 93 93 93 93 93 \n", "18 121 121 121 121 121 121 121 121 \n", "19 71 71 71 71 71 72 72 73 \n", "20 18 18 18 18 18 18 18 18 \n", "21 245 245 245 245 245 245 245 245 \n", "22 750 754 755 756 756 756 756 756 \n", "23 335 335 335 336 337 337 337 337 \n", "24 132 132 133 133 133 133 133 133 \n", "25 526 526 527 529 531 534 538 538 \n", "26 135 135 135 135 135 136 136 136 \n", "27 1 1 1 1 1 1 1 1 \n", "28 76 76 76 76 76 76 76 76 \n", "29 174 174 174 174 174 174 174 174 \n", ".. ... ... ... ... ... ... ... ... \n", "89 0 0 0 1 1 1 1 1 \n", "90 0 0 0 1 3 3 5 6 \n", "91 0 0 0 1 1 8 8 18 \n", "92 0 0 0 2 2 3 3 9 \n", "93 1 1 1 1 2 3 4 7 \n", "94 0 0 0 0 2 2 2 4 \n", "95 0 0 0 0 1 1 1 2 \n", "96 0 0 0 0 1 1 1 1 \n", "97 0 0 0 0 1 3 4 4 \n", "98 0 0 0 0 1 1 1 1 \n", "99 0 0 0 0 1 1 6 15 \n", "100 0 0 0 0 1 1 3 3 \n", "101 0 0 0 0 0 1 1 3 \n", "102 0 0 0 0 0 1 1 1 \n", "103 0 0 0 0 0 1 1 6 \n", "104 0 0 0 0 0 1 1 1 \n", "105 0 0 0 0 0 0 1 1 \n", "106 0 0 0 0 0 0 1 1 \n", "107 0 0 0 0 0 0 1 1 \n", "108 0 0 0 0 0 0 1 1 \n", "109 0 0 0 0 0 0 1 4 \n", "110 0 0 0 0 0 0 1 1 \n", "111 0 0 0 0 0 0 1 1 \n", "112 0 0 0 0 0 0 0 2 \n", "113 0 0 0 0 0 0 0 1 \n", "114 0 0 0 0 0 0 0 1 \n", "115 0 0 0 0 0 0 0 1 \n", "116 0 0 0 0 0 0 0 1 \n", "117 0 0 0 0 0 0 0 1 \n", "118 0 0 0 0 0 0 0 1 \n", "\n", "[119 rows x 43 columns]" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data" ] }, { "cell_type": "code", "execution_count": 100, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0,\n", " 0,\n", " 0,\n", " 0,\n", " 0,\n", " 0,\n", " 0,\n", " 0,\n", " 0,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 20,\n", " 62,\n", " 155,\n", " 229,\n", " 322,\n", " 453,\n", " 655,\n", " 888,\n", " 1128]" ] }, "execution_count": 100, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_italy = data[data[\"Country/Region\"] == \"Italy\"]\n", "#data_italy.values[0,[3]]\n", "#type(data_italy.values)\n", "values =[]\n", "for i in range(4,len(data_italy.values[0])):\n", " values += [data_italy.values[0][i]]\n", " \n", "values" ] }, { "cell_type": "code", "execution_count": 101, "metadata": {}, "outputs": [], "source": [ "dates = []\n", "for x in data_italy:\n", " dates+= [x]\n", " \n", "dates = dates[4:]\n", "dates\n", "\n", "df = pd.DataFrame( {\n", " 'dates': dates,\n", " 'values' : values, \n", " 'el': [i for i in range(1,len(values)+1)] \n", " })" ] }, { "cell_type": "code", "execution_count": 102, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
datesvaluesel
01/22/2001
11/23/2002
21/24/2003
31/25/2004
41/26/2005
\n", "
" ], "text/plain": [ " dates values el\n", "0 1/22/20 0 1\n", "1 1/23/20 0 2\n", "2 1/24/20 0 3\n", "3 1/25/20 0 4\n", "4 1/26/20 0 5" ] }, "execution_count": 102, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 103, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverlabel": { "namelength": 0 }, "hovertemplate": "el=%{x}
values=%{marker.color}", "legendgroup": "", "marker": { "color": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 20, 62, 155, 229, 322, 453, 655, 888, 1128 ], "coloraxis": "coloraxis", "symbol": "circle" }, "mode": "markers", "name": "", "showlegend": false, "type": "scatter", "x": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 20, 62, 155, 229, 322, 453, 655, 888, 1128 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
values = 13.535 * el + -168.957
R2=0.365507

el=%{x}
values=%{y} (trend)", "legendgroup": "", "marker": { "symbol": "circle" }, "mode": "lines", "name": "", "showlegend": false, "type": "scatter", "x": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ], "xaxis": "x", "y": [ -155.42179487179496, -141.88677462887998, -128.351754385965, -114.81673414305001, -101.28171390013503, -87.74669365722005, -74.21167341430507, -60.676653171390086, -47.141632928475104, -33.60661268556012, -20.07159244264514, -6.536572199730159, 6.998448043184823, 20.533468286099804, 34.068488529014786, 47.60350877192977, 61.13852901484475, 74.67354925775973, 88.20856950067471, 101.7435897435897, 115.27860998650468, 128.81363022941966, 142.34865047233464, 155.88367071524962, 169.4186909581646, 182.95371120107959, 196.48873144399457, 210.02375168690955, 223.55877192982453, 237.0937921727395, 250.6288124156545, 264.1638326585695, 277.69885290148443, 291.23387314439947, 304.7688933873144, 318.30391363022943, 331.83893387314436, 345.3739541160594, 358.90897435897443 ], "yaxis": "y" } ], "layout": { "coloraxis": { "colorbar": { "title": { "text": "values" } }, "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" ] ] }, "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "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": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "el" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "values" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "fig = px.scatter(df,x = \"el\",y=\"values\", trendline=\"ols\", color=\"values\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverlabel": { "namelength": 0 }, "hovertemplate": "dates=%{x}
values=%{y}", "legendgroup": "", "line": { "color": "#636efa", "dash": "solid" }, "mode": "lines", "name": "", "showlegend": false, "type": "scatter", "x": [ "1/22/20", "1/23/20", "1/24/20", "1/25/20", "1/26/20", "1/27/20", "1/28/20", "1/29/20", "1/30/20", "1/31/20", "2/1/20", "2/2/20", "2/3/20", "2/4/20", "2/5/20", "2/6/20", "2/7/20", "2/8/20", "2/9/20", "2/10/20", "2/11/20", "2/12/20", "2/13/20", "2/14/20", "2/15/20", "2/16/20", "2/17/20", "2/18/20", "2/19/20", "2/20/20", "2/21/20", "2/22/20", "2/23/20", "2/24/20", "2/25/20", "2/26/20", "2/27/20", "2/28/20", "2/29/20" ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 20, 62, 155, 229, 322, 453, 655, 888, 1128 ], "yaxis": "y" } ], "layout": { "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "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": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "dates" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "values" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "fig = px.line(df,x = \"dates\", y=\"values\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## LINEAR REGRESSION with Sklearn" ] }, { "cell_type": "code", "execution_count": 105, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:13: SettingWithCopyWarning:\n", "\n", "\n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", "\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD4CAYAAAAEhuazAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3deZhU1bX38e+SQVscGhUUGhCNiGN8wY5jNEaiDA4QHKKooHKDXvAmMb5EiNeoiclViRq9NigCiorihOKAIhJNriYQmyGAItIKQ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Y2XGEc/xp5qIEM2thZntWPCcM/i2ostsLQP9o1s8JwGcV5YwYVNubyobzWcULQMXsnQHA5BT7TAXONLOWURnjzKgtY8ysB3A9cK67b6hmn5r8njSoKuNMP67m898BOpnZQdFfiRcR/h0y7UfA++5emmpjNpzPWol7xDmXHsD3CX9uzgPmRo9ewNXA1dE+1wDvEmYkzABOiiHOg6PP/2cUyw1Re+U4DSgizKKYDxTGdE53JyTzvSu1ZcX5JHwhrQQ2E3qfA4F9genA4ujnPtG+hcCYSu+9EiiJHlfEEGcJoU5e8Xt6f7RvW2DKjn5PMhzno9Hv3zxCQm9TNc7odS/C7LoP44gzan+44vey0r6xnc/6PrS8g4hIAqnsIyKSQEr+IiIJpOQvIpJASv4iIgmk5C8ikkBK/iIiCaTkLyKSQP8HB6i0UkNfaGIAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Accuracy: 0.6462621687070127\n" ] } ], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt # To visualize\n", "import pandas as pd # To read data\n", "from sklearn.linear_model import LinearRegression\n", "\n", "\n", "#rescaling the values to get a better accuracy\n", "df[\"el\"]\n", "\n", "j = 1\n", "for i in range(len(df[\"el\"])):\n", " if(i >= 20):\n", " df[\"el\"][i]=j\n", " j+=1\n", " \n", "X = df.iloc[20:, 2].values.reshape(-1, 1) # values converts it into a numpy array\n", "Y = df.iloc[20:, 1].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n", "linear_regressor = LinearRegression() # create object for the class\n", "linear_regressor.fit(X, Y) # perform linear regression\n", "acc = linear_regressor.score(X, Y)\n", "Y_pred = linear_regressor.predict(X) # make predictions\n", "plt.scatter(X, Y)\n", "plt.plot(X, Y_pred, color='red')\n", "plt.show()\n", "print(\"Accuracy:\" ,acc)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# EVALUATION IN CHINA" ] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Province/StateCountry/RegionLatLong1/22/201/23/201/24/201/25/201/26/201/27/20...2/20/202/21/202/22/202/23/202/24/202/25/202/26/202/27/202/28/202/29/20
0AnhuiMainland China31.82570117.22641915396070...987988989989989989989989990990
1BeijingMainland China40.18240116.4142142236416880...395396399399399400400410410411
2ChongqingMainland China30.05720107.874069275775110...567572573575576576576576576576
3FujianMainland China26.07890117.98741510183559...293293293293293294294296296296
4GansuMainland China36.06110103.83430224714...91919191919191919191
5GuangdongMainland China23.34170113.424426325378111151...1332133313391342134513471347134713481349
6GuangxiMainland China23.82980108.78812523233646...245246249249251252252252252252
7GuizhouMainland China26.81540106.8748133457...146146146146146146146146146146
8HainanMainland China19.19590109.7453458192233...168168168168168168168168168168
9HebeiMainland China38.04280114.514911281318...307308309311311311312317318318
10HeilongjiangMainland China47.86200127.761502491521...476479479480480480480480480480
11HenanMainland China33.88202113.61405593283128...1265126712701271127112711271127212721272
12HubeiMainland China30.97560112.270744444454976110581423...62442626626408464084642876478665187655966591466337
13HunanMainland China27.61040111.708849244369100...1010101110131016101610161016101710171018
14Inner MongoliaMainland China44.09350113.94480017711...75757575757575757575
15JiangsuMainland China32.97110119.4550159183347...631631631631631631631631631631
16JiangxiMainland China27.61400115.72212718183672...934934934934934934934934935935
17JilinMainland China43.66610126.1923013446...91919191939393939393
18LiaoningMainland China41.29560122.6085234172127...121121121121121121121121121121
19NingxiaMainland China37.26920106.1655112347...71717171717171727273
20QinghaiMainland China35.7452095.9956000116...18181818181818181818
21ShaanxiMainland China35.19170108.8701035152235...245245245245245245245245245245
22ShandongMainland China36.34270118.14982615274675...546749750754755756756756756756
23ShanghaiMainland China31.20200121.449191620334053...334334335335335336337337337337
24ShanxiMainland China37.57770112.29221116913...132132132132133133133133133133
25SichuanMainland China30.61710102.71035815284469...520525526526527529531534538538
26TianjinMainland China39.30540117.3230448101423...131132135135135135135136136136
27TibetMainland China31.6927088.0924000000...1111111111
28XinjiangMainland China41.1129085.2401022345...76767676767676767676
29YunnanMainland China24.97400101.4870125111626...174174174174174174174174174174
30ZhejiangMainland China29.18320120.093410274362104128...1175120312051205120512051205120512051205
\n", "

31 rows × 43 columns

\n", "
" ], "text/plain": [ " Province/State Country/Region Lat Long 1/22/20 1/23/20 \\\n", "0 Anhui Mainland China 31.82570 117.2264 1 9 \n", "1 Beijing Mainland China 40.18240 116.4142 14 22 \n", "2 Chongqing Mainland China 30.05720 107.8740 6 9 \n", "3 Fujian Mainland China 26.07890 117.9874 1 5 \n", "4 Gansu Mainland China 36.06110 103.8343 0 2 \n", "5 Guangdong Mainland China 23.34170 113.4244 26 32 \n", "6 Guangxi Mainland China 23.82980 108.7881 2 5 \n", "7 Guizhou Mainland China 26.81540 106.8748 1 3 \n", "8 Hainan Mainland China 19.19590 109.7453 4 5 \n", "9 Hebei Mainland China 38.04280 114.5149 1 1 \n", "10 Heilongjiang Mainland China 47.86200 127.7615 0 2 \n", "11 Henan Mainland China 33.88202 113.6140 5 5 \n", "12 Hubei Mainland China 30.97560 112.2707 444 444 \n", "13 Hunan Mainland China 27.61040 111.7088 4 9 \n", "14 Inner Mongolia Mainland China 44.09350 113.9448 0 0 \n", "15 Jiangsu Mainland China 32.97110 119.4550 1 5 \n", "16 Jiangxi Mainland China 27.61400 115.7221 2 7 \n", "17 Jilin Mainland China 43.66610 126.1923 0 1 \n", "18 Liaoning Mainland China 41.29560 122.6085 2 3 \n", "19 Ningxia Mainland China 37.26920 106.1655 1 1 \n", "20 Qinghai Mainland China 35.74520 95.9956 0 0 \n", "21 Shaanxi Mainland China 35.19170 108.8701 0 3 \n", "22 Shandong Mainland China 36.34270 118.1498 2 6 \n", "23 Shanghai Mainland China 31.20200 121.4491 9 16 \n", "24 Shanxi Mainland China 37.57770 112.2922 1 1 \n", "25 Sichuan Mainland China 30.61710 102.7103 5 8 \n", "26 Tianjin Mainland China 39.30540 117.3230 4 4 \n", "27 Tibet Mainland China 31.69270 88.0924 0 0 \n", "28 Xinjiang Mainland China 41.11290 85.2401 0 2 \n", "29 Yunnan Mainland China 24.97400 101.4870 1 2 \n", "30 Zhejiang Mainland China 29.18320 120.0934 10 27 \n", "\n", " 1/24/20 1/25/20 1/26/20 1/27/20 ... 2/20/20 2/21/20 2/22/20 \\\n", "0 15 39 60 70 ... 987 988 989 \n", "1 36 41 68 80 ... 395 396 399 \n", "2 27 57 75 110 ... 567 572 573 \n", "3 10 18 35 59 ... 293 293 293 \n", "4 2 4 7 14 ... 91 91 91 \n", "5 53 78 111 151 ... 1332 1333 1339 \n", "6 23 23 36 46 ... 245 246 249 \n", "7 3 4 5 7 ... 146 146 146 \n", "8 8 19 22 33 ... 168 168 168 \n", "9 2 8 13 18 ... 307 308 309 \n", "10 4 9 15 21 ... 476 479 479 \n", "11 9 32 83 128 ... 1265 1267 1270 \n", "12 549 761 1058 1423 ... 62442 62662 64084 \n", "13 24 43 69 100 ... 1010 1011 1013 \n", "14 1 7 7 11 ... 75 75 75 \n", "15 9 18 33 47 ... 631 631 631 \n", "16 18 18 36 72 ... 934 934 934 \n", "17 3 4 4 6 ... 91 91 91 \n", "18 4 17 21 27 ... 121 121 121 \n", "19 2 3 4 7 ... 71 71 71 \n", "20 0 1 1 6 ... 18 18 18 \n", "21 5 15 22 35 ... 245 245 245 \n", "22 15 27 46 75 ... 546 749 750 \n", "23 20 33 40 53 ... 334 334 335 \n", "24 1 6 9 13 ... 132 132 132 \n", "25 15 28 44 69 ... 520 525 526 \n", "26 8 10 14 23 ... 131 132 135 \n", "27 0 0 0 0 ... 1 1 1 \n", "28 2 3 4 5 ... 76 76 76 \n", "29 5 11 16 26 ... 174 174 174 \n", "30 43 62 104 128 ... 1175 1203 1205 \n", "\n", " 2/23/20 2/24/20 2/25/20 2/26/20 2/27/20 2/28/20 2/29/20 \n", "0 989 989 989 989 989 990 990 \n", "1 399 399 400 400 410 410 411 \n", "2 575 576 576 576 576 576 576 \n", "3 293 293 294 294 296 296 296 \n", "4 91 91 91 91 91 91 91 \n", "5 1342 1345 1347 1347 1347 1348 1349 \n", "6 249 251 252 252 252 252 252 \n", "7 146 146 146 146 146 146 146 \n", "8 168 168 168 168 168 168 168 \n", "9 311 311 311 312 317 318 318 \n", "10 480 480 480 480 480 480 480 \n", "11 1271 1271 1271 1271 1272 1272 1272 \n", "12 64084 64287 64786 65187 65596 65914 66337 \n", "13 1016 1016 1016 1016 1017 1017 1018 \n", "14 75 75 75 75 75 75 75 \n", "15 631 631 631 631 631 631 631 \n", "16 934 934 934 934 934 935 935 \n", "17 91 93 93 93 93 93 93 \n", "18 121 121 121 121 121 121 121 \n", "19 71 71 71 71 72 72 73 \n", "20 18 18 18 18 18 18 18 \n", "21 245 245 245 245 245 245 245 \n", "22 754 755 756 756 756 756 756 \n", "23 335 335 336 337 337 337 337 \n", "24 132 133 133 133 133 133 133 \n", "25 526 527 529 531 534 538 538 \n", "26 135 135 135 135 136 136 136 \n", "27 1 1 1 1 1 1 1 \n", "28 76 76 76 76 76 76 76 \n", "29 174 174 174 174 174 174 174 \n", "30 1205 1205 1205 1205 1205 1205 1205 \n", "\n", "[31 rows x 43 columns]" ] }, "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_china = data[data[\"Country/Region\"] == \"Mainland China\"]\n", "data_china" ] }, { "cell_type": "code", "execution_count": 107, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1205\n", "1 [Zhejiang, Mainland China, 29.1832, 120.0934, ...\n", "Name: values, dtype: object" ] }, "execution_count": 107, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#data_italy.values[0,[3]]\n", "#type(data_italy.values)\n", "df = {}\n", "for i in range(len(data_china.values)):\n", " for j in range(4, len(data_china.values[i])):\n", " df[\"values\"] = [data_china.values[i][j],data_china.values[i]]\n", "pd.DataFrame(df)[\"values\"]" ] }, { "cell_type": "code", "execution_count": 108, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "40.1824" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_china.values[1][2]" ] }, { "cell_type": "code", "execution_count": 109, "metadata": {}, "outputs": [], "source": [ "china_cities = []\n", "count = 1\n", "ind = []\n", "for i in range(len(data_china.values)):\n", " count = 0\n", " for j in range(len(data_china.values[i][4:])):\n", " china_cities+= [data_china.values[i][0]]\n", " ind += [count]\n", " count += 1" ] }, { "cell_type": "code", "execution_count": 110, "metadata": {}, "outputs": [], "source": [ "china_values=[]\n", "for i in range(len(data_china.values)):\n", " for j in range(4,len(data_china.values[i])): \n", " china_values+= [data_china.values[i][j]]\n", " " ] }, { "cell_type": "code", "execution_count": 111, "metadata": {}, "outputs": [], "source": [ "df_china = pd.DataFrame(list(zip(china_values, china_cities,ind)), \n", " columns =['Values', 'Cities','Lags']) " ] }, { "cell_type": "code", "execution_count": 112, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ValuesCitiesLags
01Anhui0
19Anhui1
215Anhui2
339Anhui3
460Anhui4
570Anhui5
6106Anhui6
7152Anhui7
8200Anhui8
9237Anhui9
10297Anhui10
11340Anhui11
12408Anhui12
13480Anhui13
14530Anhui14
15591Anhui15
16665Anhui16
17733Anhui17
18779Anhui18
19830Anhui19
20860Anhui20
21889Anhui21
22910Anhui22
23934Anhui23
24950Anhui24
25962Anhui25
26973Anhui26
27982Anhui27
28986Anhui28
29987Anhui29
............
1179538Zhejiang9
1180599Zhejiang10
1181661Zhejiang11
1182724Zhejiang12
1183829Zhejiang13
1184895Zhejiang14
1185954Zhejiang15
11861006Zhejiang16
11871048Zhejiang17
11881075Zhejiang18
11891092Zhejiang19
11901117Zhejiang20
11911131Zhejiang21
11921145Zhejiang22
11931155Zhejiang23
11941162Zhejiang24
11951167Zhejiang25
11961171Zhejiang26
11971172Zhejiang27
11981174Zhejiang28
11991175Zhejiang29
12001203Zhejiang30
12011205Zhejiang31
12021205Zhejiang32
12031205Zhejiang33
12041205Zhejiang34
12051205Zhejiang35
12061205Zhejiang36
12071205Zhejiang37
12081205Zhejiang38
\n", "

1209 rows × 3 columns

\n", "
" ], "text/plain": [ " Values Cities Lags\n", "0 1 Anhui 0\n", "1 9 Anhui 1\n", "2 15 Anhui 2\n", "3 39 Anhui 3\n", "4 60 Anhui 4\n", "5 70 Anhui 5\n", "6 106 Anhui 6\n", "7 152 Anhui 7\n", "8 200 Anhui 8\n", "9 237 Anhui 9\n", "10 297 Anhui 10\n", "11 340 Anhui 11\n", "12 408 Anhui 12\n", "13 480 Anhui 13\n", "14 530 Anhui 14\n", "15 591 Anhui 15\n", "16 665 Anhui 16\n", "17 733 Anhui 17\n", "18 779 Anhui 18\n", "19 830 Anhui 19\n", "20 860 Anhui 20\n", "21 889 Anhui 21\n", "22 910 Anhui 22\n", "23 934 Anhui 23\n", "24 950 Anhui 24\n", "25 962 Anhui 25\n", "26 973 Anhui 26\n", "27 982 Anhui 27\n", "28 986 Anhui 28\n", "29 987 Anhui 29\n", "... ... ... ...\n", "1179 538 Zhejiang 9\n", "1180 599 Zhejiang 10\n", "1181 661 Zhejiang 11\n", "1182 724 Zhejiang 12\n", "1183 829 Zhejiang 13\n", "1184 895 Zhejiang 14\n", "1185 954 Zhejiang 15\n", "1186 1006 Zhejiang 16\n", "1187 1048 Zhejiang 17\n", "1188 1075 Zhejiang 18\n", "1189 1092 Zhejiang 19\n", "1190 1117 Zhejiang 20\n", "1191 1131 Zhejiang 21\n", "1192 1145 Zhejiang 22\n", "1193 1155 Zhejiang 23\n", "1194 1162 Zhejiang 24\n", "1195 1167 Zhejiang 25\n", "1196 1171 Zhejiang 26\n", "1197 1172 Zhejiang 27\n", "1198 1174 Zhejiang 28\n", "1199 1175 Zhejiang 29\n", "1200 1203 Zhejiang 30\n", "1201 1205 Zhejiang 31\n", "1202 1205 Zhejiang 32\n", "1203 1205 Zhejiang 33\n", "1204 1205 Zhejiang 34\n", "1205 1205 Zhejiang 35\n", "1206 1205 Zhejiang 36\n", "1207 1205 Zhejiang 37\n", "1208 1205 Zhejiang 38\n", "\n", "[1209 rows x 3 columns]" ] }, "execution_count": 112, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_china" ] }, { "cell_type": "code", "execution_count": 113, "metadata": { "scrolled": true }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Anhui
Lags=%{x}
Values=%{y}", "legendgroup": "Anhui", "line": { "color": "#636efa", "dash": "solid" }, "mode": "lines", "name": "Anhui", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 9, 15, 39, 60, 70, 106, 152, 200, 237, 297, 340, 408, 480, 530, 591, 665, 733, 779, 830, 860, 889, 910, 934, 950, 962, 973, 982, 986, 987, 988, 989, 989, 989, 989, 989, 989, 990, 990 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Beijing
Lags=%{x}
Values=%{y}", "legendgroup": "Beijing", "line": { "color": "#EF553B", "dash": "solid" }, "mode": "lines", "name": "Beijing", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 14, 22, 36, 41, 68, 80, 91, 111, 114, 139, 168, 191, 212, 228, 253, 274, 297, 315, 326, 337, 342, 352, 366, 372, 375, 380, 381, 387, 393, 395, 396, 399, 399, 399, 400, 400, 410, 410, 411 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Chongqing
Lags=%{x}
Values=%{y}", "legendgroup": "Chongqing", "line": { "color": "#00cc96", "dash": "solid" }, "mode": "lines", "name": "Chongqing", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 6, 9, 27, 57, 75, 110, 132, 147, 182, 211, 247, 300, 337, 366, 389, 411, 426, 428, 468, 486, 505, 518, 529, 537, 544, 551, 553, 555, 560, 567, 572, 573, 575, 576, 576, 576, 576, 576, 576 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Fujian
Lags=%{x}
Values=%{y}", "legendgroup": "Fujian", "line": { "color": "#ab63fa", "dash": "solid" }, "mode": "lines", "name": "Fujian", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 5, 10, 18, 35, 59, 80, 84, 101, 120, 144, 159, 179, 194, 205, 215, 224, 239, 250, 261, 267, 272, 279, 281, 285, 287, 290, 292, 293, 293, 293, 293, 293, 293, 294, 294, 296, 296, 296 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Gansu
Lags=%{x}
Values=%{y}", "legendgroup": "Gansu", "line": { "color": "#FFA15A", "dash": "solid" }, "mode": "lines", "name": "Gansu", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 2, 2, 4, 7, 14, 19, 24, 26, 29, 40, 51, 55, 57, 62, 62, 67, 79, 83, 83, 86, 87, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Guangdong
Lags=%{x}
Values=%{y}", "legendgroup": "Guangdong", "line": { "color": "#19d3f3", "dash": "solid" }, "mode": "lines", "name": "Guangdong", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 26, 32, 53, 78, 111, 151, 207, 277, 354, 436, 535, 632, 725, 813, 895, 970, 1034, 1095, 1131, 1159, 1177, 1219, 1241, 1261, 1294, 1316, 1322, 1328, 1331, 1332, 1333, 1339, 1342, 1345, 1347, 1347, 1347, 1348, 1349 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Guangxi
Lags=%{x}
Values=%{y}", "legendgroup": "Guangxi", "line": { "color": "#FF6692", "dash": "solid" }, "mode": "lines", "name": "Guangxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 5, 23, 23, 36, 46, 51, 58, 78, 87, 100, 111, 127, 139, 150, 168, 172, 183, 195, 210, 215, 222, 222, 226, 235, 237, 238, 242, 244, 245, 246, 249, 249, 251, 252, 252, 252, 252, 252 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Guizhou
Lags=%{x}
Values=%{y}", "legendgroup": "Guizhou", "line": { "color": "#B6E880", "dash": "solid" }, "mode": "lines", "name": "Guizhou", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 3, 3, 4, 5, 7, 9, 9, 12, 29, 29, 38, 46, 58, 64, 71, 81, 89, 99, 109, 127, 133, 135, 140, 143, 144, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hainan
Lags=%{x}
Values=%{y}", "legendgroup": "Hainan", "line": { "color": "#FF97FF", "dash": "solid" }, "mode": "lines", "name": "Hainan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4, 5, 8, 19, 22, 33, 40, 43, 46, 52, 62, 64, 72, 80, 99, 106, 117, 124, 131, 138, 144, 157, 157, 159, 162, 162, 163, 163, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hebei
Lags=%{x}
Values=%{y}", "legendgroup": "Hebei", "line": { "color": "#FECB52", "dash": "solid" }, "mode": "lines", "name": "Hebei", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 1, 2, 8, 13, 18, 33, 48, 65, 82, 96, 104, 113, 126, 135, 157, 172, 195, 206, 218, 239, 251, 265, 283, 291, 300, 301, 306, 306, 307, 308, 309, 311, 311, 311, 312, 317, 318, 318 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Heilongjiang
Lags=%{x}
Values=%{y}", "legendgroup": "Heilongjiang", "line": { "color": "#636efa", "dash": "solid" }, "mode": "lines", "name": "Heilongjiang", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 2, 4, 9, 15, 21, 33, 38, 44, 59, 80, 95, 121, 155, 190, 227, 277, 295, 307, 331, 360, 378, 395, 419, 425, 445, 457, 464, 470, 476, 479, 479, 480, 480, 480, 480, 480, 480, 480 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Henan
Lags=%{x}
Values=%{y}", "legendgroup": "Henan", "line": { "color": "#EF553B", "dash": "solid" }, "mode": "lines", "name": "Henan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 5, 5, 9, 32, 83, 128, 168, 206, 278, 352, 422, 493, 566, 675, 764, 851, 914, 981, 1033, 1073, 1105, 1135, 1169, 1184, 1212, 1231, 1246, 1257, 1262, 1265, 1267, 1270, 1271, 1271, 1271, 1271, 1272, 1272, 1272 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hubei
Lags=%{x}
Values=%{y}", "legendgroup": "Hubei", "line": { "color": "#00cc96", "dash": "solid" }, "mode": "lines", "name": "Hubei", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 444, 444, 549, 761, 1058, 1423, 3554, 3554, 4903, 5806, 7153, 11177, 13522, 16678, 19665, 22112, 24953, 27100, 29631, 31728, 33366, 33366, 48206, 54406, 56249, 58182, 59989, 61682, 62031, 62442, 62662, 64084, 64084, 64287, 64786, 65187, 65596, 65914, 66337 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hunan
Lags=%{x}
Values=%{y}", "legendgroup": "Hunan", "line": { "color": "#ab63fa", "dash": "solid" }, "mode": "lines", "name": "Hunan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4, 9, 24, 43, 69, 100, 143, 221, 277, 332, 389, 463, 521, 593, 661, 711, 772, 803, 838, 879, 912, 946, 968, 988, 1001, 1004, 1006, 1007, 1008, 1010, 1011, 1013, 1016, 1016, 1016, 1016, 1017, 1017, 1018 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Inner Mongolia
Lags=%{x}
Values=%{y}", "legendgroup": "Inner Mongolia", "line": { "color": "#FFA15A", "dash": "solid" }, "mode": "lines", "name": "Inner Mongolia", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 0, 1, 7, 7, 11, 15, 16, 19, 20, 23, 27, 34, 35, 42, 46, 50, 52, 54, 58, 58, 60, 61, 65, 68, 70, 72, 73, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Jiangsu
Lags=%{x}
Values=%{y}", "legendgroup": "Jiangsu", "line": { "color": "#19d3f3", "dash": "solid" }, "mode": "lines", "name": "Jiangsu", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 5, 9, 18, 33, 47, 70, 99, 129, 168, 202, 236, 271, 308, 341, 373, 408, 439, 468, 492, 515, 543, 570, 593, 604, 617, 626, 629, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Jiangxi
Lags=%{x}
Values=%{y}", "legendgroup": "Jiangxi", "line": { "color": "#FF6692", "dash": "solid" }, "mode": "lines", "name": "Jiangxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 7, 18, 18, 36, 72, 109, 109, 162, 240, 286, 333, 391, 476, 548, 600, 661, 698, 740, 771, 804, 844, 872, 900, 913, 925, 930, 933, 934, 934, 934, 934, 934, 934, 934, 934, 934, 935, 935 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Jilin
Lags=%{x}
Values=%{y}", "legendgroup": "Jilin", "line": { "color": "#B6E880", "dash": "solid" }, "mode": "lines", "name": "Jilin", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 1, 3, 4, 4, 6, 8, 9, 14, 14, 17, 23, 31, 42, 54, 59, 65, 69, 78, 80, 81, 83, 84, 86, 88, 89, 89, 89, 90, 91, 91, 91, 91, 93, 93, 93, 93, 93, 93 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Liaoning
Lags=%{x}
Values=%{y}", "legendgroup": "Liaoning", "line": { "color": "#FF97FF", "dash": "solid" }, "mode": "lines", "name": "Liaoning", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 3, 4, 17, 21, 27, 34, 39, 41, 48, 64, 70, 74, 81, 89, 94, 99, 105, 107, 108, 111, 116, 117, 119, 119, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Ningxia
Lags=%{x}
Values=%{y}", "legendgroup": "Ningxia", "line": { "color": "#FECB52", "dash": "solid" }, "mode": "lines", "name": "Ningxia", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 1, 2, 3, 4, 7, 11, 12, 17, 21, 26, 28, 31, 34, 34, 40, 43, 45, 45, 49, 53, 58, 64, 67, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 73 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Qinghai
Lags=%{x}
Values=%{y}", "legendgroup": "Qinghai", "line": { "color": "#636efa", "dash": "solid" }, "mode": "lines", "name": "Qinghai", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 0, 0, 1, 1, 6, 6, 6, 8, 8, 9, 11, 13, 15, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shaanxi
Lags=%{x}
Values=%{y}", "legendgroup": "Shaanxi", "line": { "color": "#EF553B", "dash": "solid" }, "mode": "lines", "name": "Shaanxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 3, 5, 15, 22, 35, 46, 56, 63, 87, 101, 116, 128, 142, 165, 173, 184, 195, 208, 213, 219, 225, 229, 230, 232, 236, 240, 240, 242, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shandong
Lags=%{x}
Values=%{y}", "legendgroup": "Shandong", "line": { "color": "#00cc96", "dash": "solid" }, "mode": "lines", "name": "Shandong", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 6, 15, 27, 46, 75, 95, 130, 158, 184, 206, 230, 259, 275, 307, 347, 386, 416, 444, 466, 487, 497, 509, 523, 532, 537, 541, 543, 544, 546, 749, 750, 754, 755, 756, 756, 756, 756, 756 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shanghai
Lags=%{x}
Values=%{y}", "legendgroup": "Shanghai", "line": { "color": "#ab63fa", "dash": "solid" }, "mode": "lines", "name": "Shanghai", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 9, 16, 20, 33, 40, 53, 66, 96, 112, 135, 169, 182, 203, 219, 243, 257, 277, 286, 293, 299, 303, 311, 315, 318, 326, 328, 333, 333, 333, 334, 334, 335, 335, 335, 336, 337, 337, 337, 337 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shanxi
Lags=%{x}
Values=%{y}", "legendgroup": "Shanxi", "line": { "color": "#FFA15A", "dash": "solid" }, "mode": "lines", "name": "Shanxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 1, 1, 6, 9, 13, 27, 27, 35, 39, 47, 66, 74, 81, 81, 96, 104, 115, 119, 119, 124, 126, 126, 127, 128, 129, 130, 131, 131, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Sichuan
Lags=%{x}
Values=%{y}", "legendgroup": "Sichuan", "line": { "color": "#19d3f3", "dash": "solid" }, "mode": "lines", "name": "Sichuan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 5, 8, 15, 28, 44, 69, 90, 108, 142, 177, 207, 231, 254, 282, 301, 321, 344, 364, 386, 405, 417, 436, 451, 463, 470, 481, 495, 508, 514, 520, 525, 526, 526, 527, 529, 531, 534, 538, 538 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Tianjin
Lags=%{x}
Values=%{y}", "legendgroup": "Tianjin", "line": { "color": "#FF6692", "dash": "solid" }, "mode": "lines", "name": "Tianjin", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4, 4, 8, 10, 14, 23, 24, 27, 31, 32, 41, 48, 60, 67, 69, 79, 81, 88, 91, 95, 106, 112, 119, 120, 122, 124, 125, 128, 130, 131, 132, 135, 135, 135, 135, 135, 136, 136, 136 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Tibet
Lags=%{x}
Values=%{y}", "legendgroup": "Tibet", "line": { "color": "#B6E880", "dash": "solid" }, "mode": "lines", "name": "Tibet", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Xinjiang
Lags=%{x}
Values=%{y}", "legendgroup": "Xinjiang", "line": { "color": "#FF97FF", "dash": "solid" }, "mode": "lines", "name": "Xinjiang", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 2, 2, 3, 4, 5, 10, 13, 14, 17, 18, 21, 24, 29, 32, 36, 39, 42, 45, 49, 55, 59, 63, 65, 70, 71, 75, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Yunnan
Lags=%{x}
Values=%{y}", "legendgroup": "Yunnan", "line": { "color": "#FECB52", "dash": "solid" }, "mode": "lines", "name": "Yunnan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 2, 5, 11, 16, 26, 44, 55, 70, 83, 93, 105, 117, 122, 128, 133, 138, 138, 141, 149, 153, 154, 156, 162, 168, 171, 171, 172, 172, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Zhejiang
Lags=%{x}
Values=%{y}", "legendgroup": "Zhejiang", "line": { "color": "#636efa", "dash": "solid" }, "mode": "lines", "name": "Zhejiang", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 10, 27, 43, 62, 104, 128, 173, 296, 428, 538, 599, 661, 724, 829, 895, 954, 1006, 1048, 1075, 1092, 1117, 1131, 1145, 1155, 1162, 1167, 1171, 1172, 1174, 1175, 1203, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "Cities" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "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": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "Lags" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "Values" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "fig = px.line(df_china, x=\"Lags\", y = \"Values\", color=\"Cities\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 114, "metadata": {}, "outputs": [ { "ename": "ModuleNotFoundError", "evalue": "No module named 'plotnine'", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpandas\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapi\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtypes\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mCategoricalDtype\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mplotnine\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mplotnine\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmpg\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m (ggplot(df_china)\n", "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'plotnine'" ] } ], "source": [ "import pandas as pd\n", "import numpy as np\n", "from pandas.api.types import CategoricalDtype\n", "from plotnine import *\n", "from plotnine.data import mpg\n", "(ggplot(df_china)\n", " + aes(x='Lags', y='Values', color='Cities')\n", " + geom_line()\n", " + labs(title='China Covid-19 Virus cases', x='Days', y='Number of case')\n", ")" ] }, { "cell_type": "code", "execution_count": 115, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Anhui
Lags=%{x}
Values=%{y}", "legendgroup": "Anhui", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers", "name": "Anhui", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 9, 15, 39, 60, 70, 106, 152, 200, 237, 297, 340, 408, 480, 530, 591, 665, 733, 779, 830, 860, 889, 910, 934, 950, 962, 973, 982, 986, 987, 988, 989, 989, 989, 989, 989, 989, 990, 990 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 31.4743 * Lags + 39.8603
R2=0.889861

Cities=Anhui
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Anhui", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "lines", "name": "Anhui", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 39.86025641025644, 71.33454790823215, 102.80883940620787, 134.28313090418357, 165.7574224021593, 197.231713900135, 228.70600539811073, 260.1802968960864, 291.65458839406216, 323.1288798920379, 354.6031713900136, 386.07746288798927, 417.551754385965, 449.02604588394075, 480.50033738191644, 511.9746288798921, 543.4489203778678, 574.9232118758435, 606.3975033738193, 637.8717948717949, 669.3460863697707, 700.8203778677464, 732.294669365722, 763.7689608636978, 795.2432523616735, 826.7175438596493, 858.191835357625, 889.6661268556006, 921.1404183535764, 952.6147098515521, 984.0890013495277, 1015.5632928475035, 1047.0375843454792, 1078.5118758434548, 1109.9861673414307, 1141.4604588394063, 1172.9347503373822, 1204.4090418353578, 1235.8833333333334 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Beijing
Lags=%{x}
Values=%{y}", "legendgroup": "Beijing", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "markers", "name": "Beijing", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 14, 22, 36, 41, 68, 80, 91, 111, 114, 139, 168, 191, 212, 228, 253, 274, 297, 315, 326, 337, 342, 352, 366, 372, 375, 380, 381, 387, 393, 395, 396, 399, 399, 399, 400, 400, 410, 410, 411 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 11.3733 * Lags + 57.8564
R2=0.897585

Cities=Beijing
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Beijing", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "lines", "name": "Beijing", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 57.8564102564103, 69.22968960863702, 80.60296896086375, 91.97624831309047, 103.3495276653172, 114.72280701754391, 126.09608636977063, 137.46936572199735, 148.8426450742241, 160.21592442645078, 171.58920377867753, 182.96248313090425, 194.33576248313096, 205.70904183535768, 217.08232118758443, 228.45560053981114, 239.82887989203786, 251.20215924426458, 262.57543859649127, 273.948717948718, 285.32199730094476, 296.6952766531715, 308.0685560053982, 319.44183535762494, 330.8151147098516, 342.1883940620784, 353.56167341430506, 364.9349527665318, 376.30823211875855, 387.68151147098524, 399.054790823212, 410.4280701754387, 421.8013495276654, 433.17462887989217, 444.54790823211886, 455.9211875843456, 467.2944669365723, 478.66774628879904, 490.0410256410258 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Chongqing
Lags=%{x}
Values=%{y}", "legendgroup": "Chongqing", "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "markers", "name": "Chongqing", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 6, 9, 27, 57, 75, 110, 132, 147, 182, 211, 247, 300, 337, 366, 389, 411, 426, 428, 468, 486, 505, 518, 529, 537, 544, 551, 553, 555, 560, 567, 572, 573, 575, 576, 576, 576, 576, 576, 576 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 16.3395 * Lags + 84.6526
R2=0.875844

Cities=Chongqing
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Chongqing", "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "lines", "name": "Chongqing", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 84.65256410256413, 100.99203778677466, 117.33151147098519, 133.67098515519572, 150.01045883940625, 166.3499325236168, 182.68940620782732, 199.02887989203785, 215.36835357624838, 231.7078272604589, 248.04730094466944, 264.38677462887995, 280.72624831309054, 297.065721997301, 313.4051956815116, 329.7446693657221, 346.08414304993266, 362.42361673414314, 378.7630904183537, 395.1025641025642, 411.4420377867748, 427.78151147098527, 444.12098515519585, 460.46045883940633, 476.7999325236169, 493.1394062078274, 509.478879892038, 525.8183535762485, 542.157827260459, 558.4973009446695, 574.8367746288801, 591.1762483130906, 607.5157219973012, 623.8551956815118, 640.1946693657222, 656.5341430499327, 672.8736167341433, 689.2130904183539, 705.5525641025644 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Fujian
Lags=%{x}
Values=%{y}", "legendgroup": "Fujian", "marker": { "color": "#ab63fa", "symbol": "circle" }, "mode": "markers", "name": "Fujian", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 5, 10, 18, 35, 59, 80, 84, 101, 120, 144, 159, 179, 194, 205, 215, 224, 239, 250, 261, 267, 272, 279, 281, 285, 287, 290, 292, 293, 293, 293, 293, 293, 293, 294, 294, 296, 296, 296 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 8.31032 * Lags + 49.0269
R2=0.850670

Cities=Fujian
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Fujian", "marker": { "color": "#ab63fa", "symbol": "circle" }, "mode": "lines", "name": "Fujian", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 49.026923076923104, 57.337246963562784, 65.64757085020246, 73.95789473684214, 82.26821862348181, 90.5785425101215, 98.88886639676116, 107.19919028340084, 115.50951417004052, 123.8198380566802, 132.13016194331988, 140.44048582995956, 148.75080971659924, 157.06113360323891, 165.3714574898786, 173.68178137651827, 181.99210526315795, 190.30242914979763, 198.6127530364373, 206.923076923077, 215.23340080971667, 223.54372469635635, 231.85404858299603, 240.1643724696357, 248.47469635627536, 256.78502024291504, 265.0953441295547, 273.4056680161944, 281.71599190283405, 290.02631578947376, 298.3366396761134, 306.6469635627531, 314.95728744939277, 323.2676113360324, 331.5779352226721, 339.8882591093118, 348.1985829959515, 356.50890688259113, 364.81923076923084 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Gansu
Lags=%{x}
Values=%{y}", "legendgroup": "Gansu", "marker": { "color": "#FFA15A", "symbol": "circle" }, "mode": "markers", "name": "Gansu", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 2, 2, 4, 7, 14, 19, 24, 26, 29, 40, 51, 55, 57, 62, 62, 67, 79, 83, 83, 86, 87, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 2.67571 * Lags + 12.8026
R2=0.833059

Cities=Gansu
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Gansu", "marker": { "color": "#FFA15A", "symbol": "circle" }, "mode": "lines", "name": "Gansu", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 12.802564102564109, 15.478272604588401, 18.15398110661269, 20.829689608636983, 23.505398110661275, 26.181106612685568, 28.856815114709857, 31.53252361673415, 34.208232118758445, 36.88394062078274, 39.55964912280703, 42.235357624831316, 44.9110661268556, 47.586774628879894, 50.26248313090419, 52.93819163292848, 55.61390013495277, 58.289608636977064, 60.96531713900136, 63.64102564102565, 66.31673414304994, 68.99244264507423, 71.66815114709853, 74.34385964912282, 77.0195681511471, 79.69527665317139, 82.37098515519568, 85.04669365721998, 87.72240215924427, 90.39811066126856, 93.07381916329285, 95.74952766531715, 98.42523616734144, 101.10094466936573, 103.77665317139002, 106.45236167341432, 109.12807017543861, 111.8037786774629, 114.4794871794872 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Guangdong
Lags=%{x}
Values=%{y}", "legendgroup": "Guangdong", "marker": { "color": "#19d3f3", "symbol": "circle" }, "mode": "markers", "name": "Guangdong", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 26, 32, 53, 78, 111, 151, 207, 277, 354, 436, 535, 632, 725, 813, 895, 970, 1034, 1095, 1131, 1159, 1177, 1219, 1241, 1261, 1294, 1316, 1322, 1328, 1331, 1332, 1333, 1339, 1342, 1345, 1347, 1347, 1347, 1348, 1349 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 40.0028 * Lags + 153.587
R2=0.863437

Cities=Guangdong
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Guangdong", "marker": { "color": "#19d3f3", "symbol": "circle" }, "mode": "lines", "name": "Guangdong", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 153.5871794871795, 193.59001349527665, 233.59284750337383, 273.595681511471, 313.5985155195682, 353.6013495276653, 393.6041835357625, 433.6070175438597, 473.6098515519568, 513.612685560054, 553.6155195681512, 593.6183535762483, 633.6211875843455, 673.6240215924427, 713.6268556005398, 753.629689608637, 793.6325236167341, 833.6353576248313, 873.6381916329285, 913.6410256410256, 953.6438596491229, 993.64669365722, 1033.6495276653172, 1073.6523616734144, 1113.6551956815115, 1153.6580296896086, 1193.660863697706, 1233.663697705803, 1273.6665317139002, 1313.6693657219973, 1353.6721997300947, 1393.6750337381918, 1433.677867746289, 1473.680701754386, 1513.6835357624832, 1553.6863697705805, 1593.6892037786777, 1633.6920377867748, 1673.694871794872 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Guangxi
Lags=%{x}
Values=%{y}", "legendgroup": "Guangxi", "marker": { "color": "#FF6692", "symbol": "circle" }, "mode": "markers", "name": "Guangxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 5, 23, 23, 36, 46, 51, 58, 78, 87, 100, 111, 127, 139, 150, 168, 172, 183, 195, 210, 215, 222, 222, 226, 235, 237, 238, 242, 244, 245, 246, 249, 249, 251, 252, 252, 252, 252, 252 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 7.24109 * Lags + 30.2397
R2=0.904101

Cities=Guangxi
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Guangxi", "marker": { "color": "#FF6692", "symbol": "circle" }, "mode": "lines", "name": "Guangxi", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 30.239743589743597, 37.480836707152505, 44.721929824561414, 51.96302294197032, 59.20411605937923, 66.44520917678814, 73.68630229419705, 80.92739541160596, 88.16848852901487, 95.40958164642377, 102.65067476383268, 109.89176788124159, 117.1328609986505, 124.37395411605941, 131.61504723346832, 138.85614035087724, 146.09723346828613, 153.33832658569503, 160.57941970310395, 167.82051282051285, 175.06160593792177, 182.3026990553307, 189.5437921727396, 196.78488529014848, 204.0259784075574, 211.26707152496633, 218.50816464237522, 225.74925775978411, 232.99035087719304, 240.23144399460196, 247.47253711201085, 254.71363022941975, 261.9547233468287, 269.1958164642376, 276.4369095816465, 283.67800269905536, 290.9190958164643, 298.1601889338732, 305.4012820512821 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Guizhou
Lags=%{x}
Values=%{y}", "legendgroup": "Guizhou", "marker": { "color": "#B6E880", "symbol": "circle" }, "mode": "markers", "name": "Guizhou", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 3, 3, 4, 5, 7, 9, 9, 12, 29, 29, 38, 46, 58, 64, 71, 81, 89, 99, 109, 127, 133, 135, 140, 143, 144, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 4.90769 * Lags + -3.86154
R2=0.896873

Cities=Guizhou
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Guizhou", "marker": { "color": "#B6E880", "symbol": "circle" }, "mode": "lines", "name": "Guizhou", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -3.8615384615384656, 1.0461538461538433, 5.953846153846152, 10.861538461538462, 15.76923076923077, 20.676923076923078, 25.58461538461539, 30.492307692307698, 35.400000000000006, 40.307692307692314, 45.21538461538462, 50.12307692307693, 55.030769230769245, 59.93846153846155, 64.84615384615387, 69.75384615384615, 74.66153846153847, 79.56923076923078, 84.4769230769231, 89.38461538461542, 94.2923076923077, 99.20000000000002, 104.10769230769233, 109.01538461538465, 113.92307692307696, 118.83076923076925, 123.73846153846156, 128.64615384615388, 133.5538461538462, 138.4615384615385, 143.3692307692308, 148.2769230769231, 153.18461538461543, 158.09230769230774, 163.00000000000006, 167.90769230769234, 172.81538461538466, 177.72307692307697, 182.6307692307693 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hainan
Lags=%{x}
Values=%{y}", "legendgroup": "Hainan", "marker": { "color": "#FF97FF", "symbol": "circle" }, "mode": "markers", "name": "Hainan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4, 5, 8, 19, 22, 33, 40, 43, 46, 52, 62, 64, 72, 80, 99, 106, 117, 124, 131, 138, 144, 157, 157, 159, 162, 162, 163, 163, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 4.95972 * Lags + 18.0731
R2=0.895911

Cities=Hainan
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Hainan", "marker": { "color": "#FF97FF", "symbol": "circle" }, "mode": "lines", "name": "Hainan", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 18.073076923076936, 23.03279352226722, 27.992510121457503, 32.952226720647786, 37.91194331983807, 42.87165991902835, 47.83137651821863, 52.79109311740892, 57.75080971659921, 62.710526315789494, 67.67024291497977, 72.62995951417005, 77.58967611336034, 82.54939271255063, 87.5091093117409, 92.46882591093119, 97.42854251012147, 102.38825910931176, 107.34797570850205, 112.30769230769232, 117.26740890688261, 122.2271255060729, 127.18684210526317, 132.14655870445344, 137.10627530364374, 142.065991902834, 147.02570850202432, 151.9854251012146, 156.94514170040486, 161.90485829959516, 166.86457489878543, 171.82429149797574, 176.784008097166, 181.74372469635628, 186.70344129554658, 191.66315789473686, 196.62287449392716, 201.58259109311743, 206.5423076923077 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hebei
Lags=%{x}
Values=%{y}", "legendgroup": "Hebei", "marker": { "color": "#FECB52", "symbol": "circle" }, "mode": "markers", "name": "Hebei", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 1, 2, 8, 13, 18, 33, 48, 65, 82, 96, 104, 113, 126, 135, 157, 172, 195, 206, 218, 239, 251, 265, 283, 291, 300, 301, 306, 306, 307, 308, 309, 311, 311, 311, 312, 317, 318, 318 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 10.0735 * Lags + -0.191026
R2=0.935173

Cities=Hebei
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Hebei", "marker": { "color": "#FECB52", "symbol": "circle" }, "mode": "lines", "name": "Hebei", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -0.19102564102564568, 9.882456140350875, 19.955937921727397, 30.02941970310392, 40.10290148448044, 50.17638326585696, 60.249865047233484, 70.32334682861, 80.39682860998653, 90.47031039136306, 100.54379217273957, 110.61727395411609, 120.69075573549262, 130.76423751686914, 140.83771929824564, 150.91120107962217, 160.9846828609987, 171.05816464237523, 181.13164642375176, 191.20512820512826, 201.2786099865048, 211.35209176788132, 221.42557354925782, 231.49905533063435, 241.57253711201088, 251.6460188933874, 261.71950067476394, 271.79298245614046, 281.86646423751694, 291.93994601889347, 302.01342780027, 312.0869095816465, 322.16039136302305, 332.2338731443996, 342.3073549257761, 352.38083670715264, 362.45431848852917, 372.52780026990564, 382.60128205128217 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Heilongjiang
Lags=%{x}
Values=%{y}", "legendgroup": "Heilongjiang", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers", "name": "Heilongjiang", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 2, 4, 9, 15, 21, 33, 38, 44, 59, 80, 95, 121, 155, 190, 227, 277, 295, 307, 331, 360, 378, 395, 419, 425, 445, 457, 464, 470, 476, 479, 479, 480, 480, 480, 480, 480, 480, 480 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 16.1702 * Lags + -27.491
R2=0.927928

Cities=Heilongjiang
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Heilongjiang", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "lines", "name": "Heilongjiang", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -27.49102564102567, -11.320782726045909, 4.8494601889338504, 21.01970310391361, 37.189946018893366, 53.36018893387312, 69.53043184885288, 85.70067476383265, 101.8709176788124, 118.04116059379216, 134.21140350877192, 150.3816464237517, 166.55188933873146, 182.7221322537112, 198.892375168691, 215.06261808367074, 231.2328609986505, 247.40310391363028, 263.57334682861, 279.7435897435898, 295.9138326585695, 312.0840755735493, 328.25431848852907, 344.4245614035088, 360.59480431848857, 376.76504723346835, 392.9352901484481, 409.10553306342786, 425.27577597840764, 441.44601889338736, 457.61626180836714, 473.78650472334687, 489.95674763832665, 506.1269905533064, 522.2972334682862, 538.4674763832659, 554.6377192982457, 570.8079622132254, 586.9782051282052 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Henan
Lags=%{x}
Values=%{y}", "legendgroup": "Henan", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "markers", "name": "Henan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 5, 5, 9, 32, 83, 128, 168, 206, 278, 352, 422, 493, 566, 675, 764, 851, 914, 981, 1033, 1073, 1105, 1135, 1169, 1184, 1212, 1231, 1246, 1257, 1262, 1265, 1267, 1270, 1271, 1271, 1271, 1271, 1272, 1272, 1272 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 39.5945 * Lags + 82.0885
R2=0.881361

Cities=Henan
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Henan", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "lines", "name": "Henan", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 82.08846153846156, 121.68299595141703, 161.2775303643725, 200.87206477732798, 240.46659919028343, 280.0611336032389, 319.65566801619434, 359.25020242914985, 398.8447368421053, 438.43927125506076, 478.0338056680162, 517.6283400809717, 557.2228744939272, 596.8174089068827, 636.4119433198382, 676.0064777327937, 715.6010121457491, 755.1955465587046, 794.79008097166, 834.3846153846155, 873.9791497975709, 913.5736842105264, 953.1682186234818, 992.7627530364373, 1032.3572874493927, 1071.9518218623482, 1111.5463562753039, 1151.1408906882593, 1190.7354251012148, 1230.3299595141702, 1269.9244939271257, 1309.5190283400811, 1349.1135627530366, 1388.708097165992, 1428.3026315789475, 1467.897165991903, 1507.4917004048584, 1547.0862348178139, 1586.6807692307693 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hubei
Lags=%{x}
Values=%{y}", "legendgroup": "Hubei", "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "markers", "name": "Hubei", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 444, 444, 549, 761, 1058, 1423, 3554, 3554, 4903, 5806, 7153, 11177, 13522, 16678, 19665, 22112, 24953, 27100, 29631, 31728, 33366, 33366, 48206, 54406, 56249, 58182, 59989, 61682, 62031, 62442, 62662, 64084, 64084, 64287, 64786, 65187, 65596, 65914, 66337 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 2224.37 * Lags + -7927.82
R2=0.945835

Cities=Hubei
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Hubei", "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "lines", "name": "Hubei", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -7927.823076923082, -5703.455870445348, -3479.0886639676155, -1254.7214574898817, 969.6457489878512, 3194.012955465584, 5418.380161943319, 7642.747368421052, 9867.114574898784, 12091.481781376518, 14315.84898785425, 16540.216194331984, 18764.58340080972, 20988.95060728745, 23213.317813765185, 25437.685020242916, 27662.05222672065, 29886.419433198385, 32110.78663967612, 34335.15384615385, 36559.521052631586, 38783.88825910932, 41008.255465587055, 43232.62267206479, 45456.989878542525, 47681.35708502025, 49905.72429149799, 52130.09149797572, 54354.45870445346, 56578.82591093119, 58803.19311740892, 61027.56032388665, 63251.92753036439, 65476.29473684212, 67700.66194331985, 69925.02914979758, 72149.39635627532, 74373.76356275305, 76598.13076923077 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Hunan
Lags=%{x}
Values=%{y}", "legendgroup": "Hunan", "marker": { "color": "#ab63fa", "symbol": "circle" }, "mode": "markers", "name": "Hunan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4, 9, 24, 43, 69, 100, 143, 221, 277, 332, 389, 463, 521, 593, 661, 711, 772, 803, 838, 879, 912, 946, 968, 988, 1001, 1004, 1006, 1007, 1008, 1010, 1011, 1013, 1016, 1016, 1016, 1016, 1017, 1017, 1018 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 30.7966 * Lags + 103.122
R2=0.861168

Cities=Hunan
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Hunan", "marker": { "color": "#ab63fa", "symbol": "circle" }, "mode": "lines", "name": "Hunan", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 103.12179487179489, 133.91835357624834, 164.71491228070178, 195.51147098515523, 226.30802968960867, 257.10458839406215, 287.9011470985156, 318.69770580296904, 349.4942645074225, 380.29082321187593, 411.0873819163294, 441.8839406207828, 472.68049932523627, 503.4770580296897, 534.2736167341432, 565.0701754385966, 595.86673414305, 626.6632928475035, 657.459851551957, 688.2564102564104, 719.0529689608638, 749.8495276653173, 780.6460863697707, 811.4426450742242, 842.2392037786776, 873.0357624831311, 903.8323211875845, 934.628879892038, 965.4254385964914, 996.2219973009448, 1027.0185560053983, 1057.8151147098517, 1088.6116734143052, 1119.4082321187586, 1150.204790823212, 1181.0013495276655, 1211.797908232119, 1242.5944669365724, 1273.3910256410259 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Inner Mongolia
Lags=%{x}
Values=%{y}", "legendgroup": "Inner Mongolia", "marker": { "color": "#FFA15A", "symbol": "circle" }, "mode": "markers", "name": "Inner Mongolia", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 0, 1, 7, 7, 11, 15, 16, 19, 20, 23, 27, 34, 35, 42, 46, 50, 52, 54, 58, 58, 60, 61, 65, 68, 70, 72, 73, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 2.27976 * Lags + 4.60769
R2=0.926254

Cities=Inner Mongolia
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Inner Mongolia", "marker": { "color": "#FFA15A", "symbol": "circle" }, "mode": "lines", "name": "Inner Mongolia", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4.607692307692308, 6.8874493927125515, 9.167206477732794, 11.446963562753037, 13.72672064777328, 16.006477732793524, 18.286234817813767, 20.56599190283401, 22.845748987854254, 25.125506072874497, 27.40526315789474, 29.685020242914984, 31.964777327935227, 34.244534412955474, 36.52429149797572, 38.80404858299596, 41.083805668016204, 43.36356275303645, 45.64331983805669, 47.923076923076934, 50.20283400809718, 52.48259109311742, 54.762348178137664, 57.04210526315791, 59.32186234817815, 61.601619433198394, 63.88137651821864, 66.16113360323888, 68.44089068825912, 70.72064777327935, 73.0004048582996, 75.28016194331985, 77.55991902834009, 79.83967611336033, 82.11943319838058, 84.39919028340083, 86.67894736842106, 88.9587044534413, 91.23846153846155 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Jiangsu
Lags=%{x}
Values=%{y}", "legendgroup": "Jiangsu", "marker": { "color": "#19d3f3", "symbol": "circle" }, "mode": "markers", "name": "Jiangsu", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 5, 9, 18, 33, 47, 70, 99, 129, 168, 202, 236, 271, 308, 341, 373, 408, 439, 468, 492, 515, 543, 570, 593, 604, 617, 626, 629, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 20.0152 * Lags + 23.6859
R2=0.904239

Cities=Jiangsu
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Jiangsu", "marker": { "color": "#19d3f3", "symbol": "circle" }, "mode": "lines", "name": "Jiangsu", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 23.68589743589743, 43.701079622132255, 63.71626180836707, 83.73144399460189, 103.74662618083671, 123.76180836707154, 143.77699055330635, 163.79217273954117, 183.807354925776, 203.82253711201082, 223.83771929824564, 243.85290148448047, 263.86808367071524, 283.88326585695006, 303.8984480431849, 323.9136302294197, 343.92881241565453, 363.94399460188936, 383.9591767881242, 403.974358974359, 423.98954116059383, 444.00472334682865, 464.0199055330635, 484.0350877192983, 504.0502699055331, 524.065452091768, 544.0806342780028, 564.0958164642376, 584.1109986504724, 604.1261808367072, 624.1413630229421, 644.1565452091769, 664.1717273954117, 684.1869095816465, 704.2020917678814, 724.2172739541162, 744.232456140351, 764.2476383265858, 784.2628205128207 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Jiangxi
Lags=%{x}
Values=%{y}", "legendgroup": "Jiangxi", "marker": { "color": "#FF6692", "symbol": "circle" }, "mode": "markers", "name": "Jiangxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 7, 18, 18, 36, 72, 109, 109, 162, 240, 286, 333, 391, 476, 548, 600, 661, 698, 740, 771, 804, 844, 872, 900, 913, 925, 930, 933, 934, 934, 934, 934, 934, 934, 934, 934, 934, 935, 935 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 29.8314 * Lags + 40.2295
R2=0.879928

Cities=Jiangxi
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Jiangxi", "marker": { "color": "#FF6692", "symbol": "circle" }, "mode": "lines", "name": "Jiangxi", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 40.22948717948718, 70.06086369770581, 99.89224021592443, 129.72361673414306, 159.5549932523617, 189.3863697705803, 219.21774628879893, 249.04912280701757, 278.8804993252362, 308.71187584345483, 338.54325236167347, 368.3746288798921, 398.20600539811073, 428.03738191632937, 457.868758434548, 487.70013495276663, 517.5315114709853, 547.3628879892038, 577.1942645074224, 607.0256410256411, 636.8570175438597, 666.6883940620784, 696.519770580297, 726.3511470985156, 756.1825236167342, 786.0139001349529, 815.8452766531715, 845.6766531713902, 875.5080296896087, 905.3394062078274, 935.170782726046, 965.0021592442647, 994.8335357624833, 1024.6649122807019, 1054.4962887989207, 1084.3276653171392, 1114.1590418353578, 1143.9904183535766, 1173.8217948717952 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Jilin
Lags=%{x}
Values=%{y}", "legendgroup": "Jilin", "marker": { "color": "#B6E880", "symbol": "circle" }, "mode": "markers", "name": "Jilin", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 1, 3, 4, 4, 6, 8, 9, 14, 14, 17, 23, 31, 42, 54, 59, 65, 69, 78, 80, 81, 83, 84, 86, 88, 89, 89, 89, 90, 91, 91, 91, 91, 93, 93, 93, 93, 93, 93 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 3.00587 * Lags + 1.40128
R2=0.874738

Cities=Jilin
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Jilin", "marker": { "color": "#B6E880", "symbol": "circle" }, "mode": "lines", "name": "Jilin", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1.4012820512820507, 4.407152496626181, 7.413022941970311, 10.418893387314442, 13.424763832658572, 16.4306342780027, 19.436504723346836, 22.442375168690965, 25.448245614035095, 28.454116059379224, 31.459986504723354, 34.46585695006748, 37.47172739541162, 40.47759784075575, 43.48346828609988, 46.48933873144401, 49.49520917678814, 52.501079622132266, 55.506950067476396, 58.512820512820525, 61.518690958164655, 64.52456140350878, 67.53043184885291, 70.53630229419704, 73.54217273954119, 76.54804318488532, 79.55391363022945, 82.55978407557357, 85.5656545209177, 88.57152496626183, 91.57739541160596, 94.58326585695009, 97.58913630229422, 100.59500674763835, 103.60087719298248, 106.60674763832661, 109.61261808367074, 112.61848852901487, 115.624358974359 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Liaoning
Lags=%{x}
Values=%{y}", "legendgroup": "Liaoning", "marker": { "color": "#FF97FF", "symbol": "circle" }, "mode": "markers", "name": "Liaoning", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 3, 4, 17, 21, 27, 34, 39, 41, 48, 64, 70, 74, 81, 89, 94, 99, 105, 107, 108, 111, 116, 117, 119, 119, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 3.31964 * Lags + 24.1833
R2=0.828501

Cities=Liaoning
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Liaoning", "marker": { "color": "#FF97FF", "symbol": "circle" }, "mode": "lines", "name": "Liaoning", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 24.183333333333337, 27.5029689608637, 30.822604588394068, 34.14224021592443, 37.4618758434548, 40.781511470985166, 44.101147098515526, 47.42078272604589, 50.74041835357626, 54.06005398110662, 57.37968960863699, 60.699325236167354, 64.01896086369771, 67.33859649122809, 70.65823211875845, 73.97786774628881, 77.29750337381918, 80.61713900134954, 83.9367746288799, 87.25641025641028, 90.57604588394064, 93.895681511471, 97.21531713900137, 100.53495276653173, 103.85458839406209, 107.17422402159247, 110.49385964912283, 113.81349527665319, 117.13313090418356, 120.45276653171392, 123.77240215924428, 127.09203778677465, 130.41167341430503, 133.73130904183537, 137.05094466936575, 140.3705802968961, 143.69021592442647, 147.00985155195684, 150.32948717948722 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Ningxia
Lags=%{x}
Values=%{y}", "legendgroup": "Ningxia", "marker": { "color": "#FECB52", "symbol": "circle" }, "mode": "markers", "name": "Ningxia", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 1, 2, 3, 4, 7, 11, 12, 17, 21, 26, 28, 31, 34, 34, 40, 43, 45, 45, 49, 53, 58, 64, 67, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 73 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 2.23117 * Lags + 2.76154
R2=0.925378

Cities=Ningxia
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Ningxia", "marker": { "color": "#FECB52", "symbol": "circle" }, "mode": "lines", "name": "Ningxia", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2.7615384615384615, 4.992712550607288, 7.223886639676114, 9.45506072874494, 11.686234817813766, 13.917408906882592, 16.14858299595142, 18.379757085020245, 20.61093117408907, 22.842105263157897, 25.073279352226724, 27.30445344129555, 29.535627530364376, 31.766801619433203, 33.99797570850203, 36.229149797570855, 38.460323886639685, 40.691497975708515, 42.92267206477734, 45.15384615384616, 47.38502024291499, 49.61619433198382, 51.84736842105264, 54.078542510121466, 56.309716599190295, 58.540890688259125, 60.77206477732795, 63.00323886639677, 65.2344129554656, 67.46558704453443, 69.69676113360325, 71.92793522267208, 74.1591093117409, 76.39028340080974, 78.62145748987857, 80.85263157894738, 83.08380566801621, 85.31497975708504, 87.54615384615386 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Qinghai
Lags=%{x}
Values=%{y}", "legendgroup": "Qinghai", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers", "name": "Qinghai", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 0, 0, 1, 1, 6, 6, 6, 8, 8, 9, 11, 13, 15, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 0.480162 * Lags + 4.54359
R2=0.705374

Cities=Qinghai
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Qinghai", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "lines", "name": "Qinghai", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4.543589743589745, 5.023751686909583, 5.503913630229421, 5.98407557354926, 6.4642375168690975, 6.9443994601889365, 7.424561403508775, 7.904723346828613, 8.38488529014845, 8.865047233468289, 9.345209176788128, 9.825371120107965, 10.305533063427804, 10.785695006747641, 11.26585695006748, 11.746018893387319, 12.226180836707156, 12.706342780026995, 13.186504723346832, 13.666666666666671, 14.146828609986509, 14.626990553306348, 15.107152496626185, 15.587314439946024, 16.067476383265863, 16.547638326585698, 17.02780026990554, 17.507962213225376, 17.988124156545215, 18.468286099865054, 18.94844804318489, 19.42860998650473, 19.908771929824567, 20.388933873144406, 20.869095816464245, 21.34925775978408, 21.82941970310392, 22.30958164642376, 22.789743589743598 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shaanxi
Lags=%{x}
Values=%{y}", "legendgroup": "Shaanxi", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "markers", "name": "Shaanxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 3, 5, 15, 22, 35, 46, 56, 63, 87, 101, 116, 128, 142, 165, 173, 184, 195, 208, 213, 219, 225, 229, 230, 232, 236, 240, 240, 242, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 7.26134 * Lags + 28.7013
R2=0.866048

Cities=Shaanxi
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Shaanxi", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "lines", "name": "Shaanxi", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 28.701282051282053, 35.96261808367072, 43.22395411605939, 50.48529014844805, 57.746626180836714, 65.00796221322538, 72.26929824561405, 79.53063427800271, 86.79197031039138, 94.05330634278005, 101.31464237516872, 108.57597840755737, 115.83731443994604, 123.09865047233471, 130.35998650472337, 137.62132253711204, 144.8826585695007, 152.14399460188937, 159.40533063427804, 166.6666666666667, 173.92800269905538, 181.18933873144402, 188.4506747638327, 195.71201079622136, 202.97334682861003, 210.2346828609987, 217.49601889338737, 224.75735492577604, 232.01869095816468, 239.28002699055335, 246.54136302294202, 253.8026990553307, 261.0640350877194, 268.32537112010806, 275.58670715249673, 282.8480431848854, 290.10937921727407, 297.37071524966274, 304.6320512820514 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shandong
Lags=%{x}
Values=%{y}", "legendgroup": "Shandong", "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "markers", "name": "Shandong", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 2, 6, 15, 27, 46, 75, 95, 130, 158, 184, 206, 230, 259, 275, 307, 347, 386, 416, 444, 466, 487, 497, 509, 523, 532, 537, 541, 543, 544, 546, 749, 750, 754, 755, 756, 756, 756, 756, 756 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 22.2429 * Lags + -9.25641
R2=0.974405

Cities=Shandong
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Shandong", "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "lines", "name": "Shandong", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -9.25641025641028, 12.986504723346808, 35.2294197031039, 57.47233468286099, 79.71524966261808, 101.95816464237517, 124.20107962213226, 146.44399460188936, 168.68690958164643, 190.9298245614035, 213.1727395411606, 235.4156545209177, 257.6585695006748, 279.90148448043186, 302.144399460189, 324.38731443994607, 346.63022941970314, 368.8731443994602, 391.1160593792173, 413.3589743589744, 435.6018893387315, 457.84480431848857, 480.0877192982457, 502.3306342780028, 524.5735492577599, 546.8164642375169, 569.059379217274, 591.3022941970311, 613.5452091767883, 635.7881241565453, 658.0310391363024, 680.2739541160595, 702.5168690958166, 724.7597840755736, 747.0026990553307, 769.2456140350878, 791.4885290148449, 813.731443994602, 835.9743589743591 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shanghai
Lags=%{x}
Values=%{y}", "legendgroup": "Shanghai", "marker": { "color": "#ab63fa", "symbol": "circle" }, "mode": "markers", "name": "Shanghai", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 9, 16, 20, 33, 40, 53, 66, 96, 112, 135, 169, 182, 203, 219, 243, 257, 277, 286, 293, 299, 303, 311, 315, 318, 326, 328, 333, 333, 333, 334, 334, 335, 335, 335, 336, 337, 337, 337, 337 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 9.41883 * Lags + 58.6064
R2=0.840140

Cities=Shanghai
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Shanghai", "marker": { "color": "#ab63fa", "symbol": "circle" }, "mode": "lines", "name": "Shanghai", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 58.606410256410264, 68.02523616734143, 77.44406207827262, 86.86288798920378, 96.28171390013497, 105.70053981106614, 115.11936572199733, 124.53819163292849, 133.95701754385968, 143.37584345479084, 152.79466936572203, 162.2134952766532, 171.63232118758438, 181.05114709851554, 190.46997300944673, 199.88879892037792, 209.30762483130908, 218.72645074224025, 228.14527665317144, 237.56410256410263, 246.9829284750338, 256.4017543859649, 265.82058029689614, 275.2394062078273, 284.65823211875846, 294.0770580296896, 303.49588394062084, 312.914709851552, 322.33353576248317, 331.7523616734143, 341.17118758434555, 350.5900134952767, 360.00883940620787, 369.42766531713903, 378.8464912280702, 388.2653171390014, 397.6841430499326, 407.10296896086373, 416.52179487179495 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Shanxi
Lags=%{x}
Values=%{y}", "legendgroup": "Shanxi", "marker": { "color": "#FFA15A", "symbol": "circle" }, "mode": "markers", "name": "Shanxi", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 1, 1, 6, 9, 13, 27, 27, 35, 39, 47, 66, 74, 81, 81, 96, 104, 115, 119, 119, 124, 126, 126, 127, 128, 129, 130, 131, 131, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 3.99393 * Lags + 14.859
R2=0.843437

Cities=Shanxi
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Shanxi", "marker": { "color": "#FFA15A", "symbol": "circle" }, "mode": "lines", "name": "Shanxi", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 14.858974358974367, 18.85290148448044, 22.846828609986513, 26.840755735492586, 30.83468286099866, 34.82860998650474, 38.82253711201081, 42.81646423751688, 46.81039136302296, 50.80431848852903, 54.7982456140351, 58.79217273954118, 62.78609986504725, 66.78002699055332, 70.7739541160594, 74.76788124156548, 78.76180836707155, 82.75573549257761, 86.74966261808369, 90.74358974358977, 94.73751686909584, 98.73144399460192, 102.725371120108, 106.71929824561406, 110.71322537112013, 114.70715249662621, 118.70107962213228, 122.69500674763836, 126.68893387314444, 130.6828609986505, 134.6767881241566, 138.67071524966266, 142.66464237516874, 146.6585695006748, 150.65249662618086, 154.64642375168694, 158.64035087719301, 162.6342780026991, 166.62820512820517 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Sichuan
Lags=%{x}
Values=%{y}", "legendgroup": "Sichuan", "marker": { "color": "#19d3f3", "symbol": "circle" }, "mode": "markers", "name": "Sichuan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 5, 8, 15, 28, 44, 69, 90, 108, 142, 177, 207, 231, 254, 282, 301, 321, 344, 364, 386, 405, 417, 436, 451, 463, 470, 481, 495, 508, 514, 520, 525, 526, 526, 527, 529, 531, 534, 538, 538 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 15.8545 * Lags + 40.0474
R2=0.927648

Cities=Sichuan
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Sichuan", "marker": { "color": "#19d3f3", "symbol": "circle" }, "mode": "lines", "name": "Sichuan", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 40.04743589743589, 55.901889338731436, 71.75634278002698, 87.61079622132254, 103.46524966261809, 119.31970310391364, 135.1741565452092, 151.02860998650476, 166.8830634278003, 182.73751686909586, 198.5919703103914, 214.44642375168695, 230.3008771929825, 246.15533063427804, 262.00978407557363, 277.86423751686914, 293.7186909581647, 309.57314439946026, 325.4275978407558, 341.2820512820513, 357.1365047233469, 372.99095816464245, 388.845411605938, 404.6998650472336, 420.55431848852913, 436.40877192982464, 452.2632253711202, 468.11767881241576, 483.9721322537113, 499.8265856950069, 515.6810391363024, 531.535492577598, 547.3899460188935, 563.244399460189, 579.0988529014846, 594.9533063427801, 610.8077597840758, 626.6622132253713, 642.5166666666668 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Tianjin
Lags=%{x}
Values=%{y}", "legendgroup": "Tianjin", "marker": { "color": "#FF6692", "symbol": "circle" }, "mode": "markers", "name": "Tianjin", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 4, 4, 8, 10, 14, 23, 24, 27, 31, 32, 41, 48, 60, 67, 69, 79, 81, 88, 91, 95, 106, 112, 119, 120, 122, 124, 125, 128, 130, 131, 132, 135, 135, 135, 135, 135, 136, 136, 136 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 4.07429 * Lags + 7.92179
R2=0.935932

Cities=Tianjin
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Tianjin", "marker": { "color": "#FF6692", "symbol": "circle" }, "mode": "lines", "name": "Tianjin", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 7.921794871794872, 11.99608636977058, 16.07037786774629, 20.144669365722, 24.21896086369771, 28.293252361673417, 32.367543859649125, 36.44183535762484, 40.51612685560055, 44.590418353576254, 48.66470985155196, 52.739001349527676, 56.813292847503384, 60.88758434547909, 64.9618758434548, 69.03616734143051, 73.11045883940622, 77.18475033738193, 81.25904183535764, 85.33333333333334, 89.40762483130905, 93.48191632928477, 97.55620782726048, 101.63049932523619, 105.7047908232119, 109.7790823211876, 113.85337381916331, 117.92766531713902, 122.00195681511474, 126.07624831309045, 130.15053981106615, 134.22483130904186, 138.29912280701757, 142.37341430499328, 146.44770580296898, 150.5219973009447, 154.5962887989204, 158.6705802968961, 162.7448717948718 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Tibet
Lags=%{x}
Values=%{y}", "legendgroup": "Tibet", "marker": { "color": "#B6E880", "symbol": "circle" }, "mode": "markers", "name": "Tibet", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 0.0251012 * Lags + 0.317949
R2=0.489474

Cities=Tibet
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Tibet", "marker": { "color": "#B6E880", "symbol": "circle" }, "mode": "lines", "name": "Tibet", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0.3179487179487181, 0.3430499325236169, 0.36815114709851565, 0.3932523616734145, 0.41835357624831326, 0.44345479082321204, 0.4685560053981108, 0.4936572199730096, 0.5187584345479084, 0.5438596491228072, 0.5689608636977059, 0.5940620782726047, 0.6191632928475035, 0.6442645074224023, 0.6693657219973012, 0.6944669365721999, 0.7195681511470987, 0.7446693657219975, 0.7697705802968963, 0.7948717948717952, 0.8199730094466939, 0.8450742240215927, 0.8701754385964915, 0.8952766531713903, 0.920377867746289, 0.9454790823211878, 0.9705802968960866, 0.9956815114709854, 1.0207827260458842, 1.045883940620783, 1.0709851551956817, 1.0960863697705805, 1.1211875843454793, 1.146288798920378, 1.1713900134952768, 1.1964912280701756, 1.2215924426450744, 1.2466936572199732, 1.2717948717948722 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Xinjiang
Lags=%{x}
Values=%{y}", "legendgroup": "Xinjiang", "marker": { "color": "#FF97FF", "symbol": "circle" }, "mode": "markers", "name": "Xinjiang", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 0, 2, 2, 3, 4, 5, 10, 13, 14, 17, 18, 21, 24, 29, 32, 36, 39, 42, 45, 49, 55, 59, 63, 65, 70, 71, 75, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 2.46053 * Lags + -1.23718
R2=0.939969

Cities=Xinjiang
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Xinjiang", "marker": { "color": "#FF97FF", "symbol": "circle" }, "mode": "lines", "name": "Xinjiang", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -1.2371794871794888, 1.2233468286099851, 3.683873144399459, 6.144399460188932, 8.604925775978407, 11.065452091767881, 13.525978407557353, 15.98650472334683, 18.447031039136302, 20.907557354925775, 23.36808367071525, 25.828609986504723, 28.289136302294196, 30.749662618083672, 33.21018893387315, 35.67071524966262, 38.13124156545209, 40.591767881241566, 43.05229419703104, 45.51282051282052, 47.97334682860999, 50.43387314439946, 52.894399460188936, 55.35492577597841, 57.81545209176788, 60.27597840755736, 62.73650472334683, 65.1970310391363, 67.65755735492579, 70.11808367071525, 72.57860998650473, 75.0391363022942, 77.49966261808368, 79.96018893387316, 82.42071524966262, 84.8812415654521, 87.34176788124157, 89.80229419703105, 92.26282051282053 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Yunnan
Lags=%{x}
Values=%{y}", "legendgroup": "Yunnan", "marker": { "color": "#FECB52", "symbol": "circle" }, "mode": "markers", "name": "Yunnan", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 1, 2, 5, 11, 16, 26, 44, 55, 70, 83, 93, 105, 117, 122, 128, 133, 138, 138, 141, 149, 153, 154, 156, 162, 168, 171, 171, 172, 172, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 4.82004 * Lags + 31.3936
R2=0.838490

Cities=Yunnan
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Yunnan", "marker": { "color": "#FECB52", "symbol": "circle" }, "mode": "lines", "name": "Yunnan", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 31.39358974358975, 36.21363022941971, 41.03367071524967, 45.85371120107963, 50.67375168690959, 55.493792172739546, 60.31383265856951, 65.13387314439947, 69.95391363022944, 74.7739541160594, 79.59399460188935, 84.4140350877193, 89.23407557354926, 94.05411605937923, 98.87415654520919, 103.69419703103915, 108.51423751686912, 113.33427800269908, 118.15431848852904, 122.97435897435898, 127.79439946018894, 132.6144399460189, 137.43448043184887, 142.25452091767883, 147.0745614035088, 151.89460188933876, 156.71464237516872, 161.53468286099869, 166.35472334682862, 171.17476383265858, 175.99480431848855, 180.8148448043185, 185.63488529014847, 190.45492577597844, 195.2749662618084, 200.09500674763837, 204.91504723346833, 209.73508771929826, 214.55512820512823 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Cities=Zhejiang
Lags=%{x}
Values=%{y}", "legendgroup": "Zhejiang", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers", "name": "Zhejiang", "showlegend": true, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 10, 27, 43, 62, 104, 128, 173, 296, 428, 538, 599, 661, 724, 829, 895, 954, 1006, 1048, 1075, 1092, 1117, 1131, 1145, 1155, 1162, 1167, 1171, 1172, 1174, 1175, 1203, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 34.4022 * Lags + 195.178
R2=0.817424

Cities=Zhejiang
Lags=%{x}
Values=%{y} (trend)", "legendgroup": "Zhejiang", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "lines", "name": "Zhejiang", "showlegend": false, "type": "scattergl", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 195.1782051282052, 229.58043184885298, 263.98265856950076, 298.38488529014853, 332.78711201079636, 367.1893387314441, 401.5915654520919, 435.9937921727397, 470.39601889338746, 504.79824561403524, 539.200472334683, 573.6026990553307, 608.0049257759786, 642.4071524966264, 676.8093792172742, 711.2116059379218, 745.6138326585697, 780.0160593792175, 814.4182860998653, 848.8205128205132, 883.2227395411608, 917.6249662618086, 952.0271929824564, 986.4294197031043, 1020.8316464237521, 1055.2338731443997, 1089.6360998650475, 1124.0383265856954, 1158.4405533063432, 1192.8427800269908, 1227.2450067476386, 1261.6472334682865, 1296.0494601889343, 1330.4516869095821, 1364.85391363023, 1399.2561403508776, 1433.6583670715254, 1468.0605937921732, 1502.462820512821 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "Cities" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "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": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "Lags" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "Values" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "fig = px.scatter(df_china, x=\"Lags\", y = \"Values\", color=\"Cities\", trendline=\"ols\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Hubei Linear regression" ] }, { "cell_type": "code", "execution_count": 116, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverlabel": { "namelength": 0 }, "hovertemplate": "Lags=%{x}
Values=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers", "name": "", "showlegend": false, "type": "scatter", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ 444, 444, 549, 761, 1058, 1423, 3554, 3554, 4903, 5806, 7153, 11177, 13522, 16678, 19665, 22112, 24953, 27100, 29631, 31728, 33366, 33366, 48206, 54406, 56249, 58182, 59989, 61682, 62031, 62442, 62662, 64084, 64084, 64287, 64786, 65187, 65596, 65914, 66337 ], "yaxis": "y" }, { "hoverlabel": { "namelength": 0 }, "hovertemplate": "OLS trendline
Values = 2224.37 * Lags + -7927.82
R2=0.945835

Lags=%{x}
Values=%{y} (trend)", "legendgroup": "", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "lines", "name": "", "showlegend": false, "type": "scatter", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "xaxis": "x", "y": [ -7927.823076923082, -5703.455870445348, -3479.0886639676155, -1254.7214574898817, 969.6457489878512, 3194.012955465584, 5418.380161943319, 7642.747368421052, 9867.114574898784, 12091.481781376518, 14315.84898785425, 16540.216194331984, 18764.58340080972, 20988.95060728745, 23213.317813765185, 25437.685020242916, 27662.05222672065, 29886.419433198385, 32110.78663967612, 34335.15384615385, 36559.521052631586, 38783.88825910932, 41008.255465587055, 43232.62267206479, 45456.989878542525, 47681.35708502025, 49905.72429149799, 52130.09149797572, 54354.45870445346, 56578.82591093119, 58803.19311740892, 61027.56032388665, 63251.92753036439, 65476.29473684212, 67700.66194331985, 69925.02914979758, 72149.39635627532, 74373.76356275305, 76598.13076923077 ], "yaxis": "y" } ], "layout": { "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "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": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "Lags" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "Values" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from sklearn.linear_model import LinearRegression\n", "df_hubei = df_china[df_china[\"Cities\"] == \"Hubei\"]\n", "df_hubei = df_hubei.drop([\"Cities\"],axis=1) \n", "\n", "fig = px.scatter(df_hubei, x=\"Lags\", y = \"Values\", trendline=\"ols\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 117, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAD6CAYAAABDPiuvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3debzWY/7H8ddHwrFNoQynKGMZKcRBxIyxVTN+U/oxU7NoxhKDkeXXKMbYxoiyZYmUJSQk1SglKktSnRZSSWcSWhApmQ5tn98f1/fk7nSf+77Pem/v5+Phce77+n7v732d2+n7ua/tc5m7IyIi+W27dFdARETST8FAREQUDERERMFARERQMBARERQMRESEFIOBmV1pZvPM7H0ze8bMdjKz5mY2zcwWmdmzZrZDdO6O0fOS6HizmOv0jsoXmlm7mPL2UVmJmfWq6V9SREQSs2TrDMysEHgLaOHupWb2HDAW+CUwwt2HmdlDwLvuPsDMLgEOd/eLzawLcJa7/9bMWgDPAMcC+wKvAgdHb/MhcDqwFJgBdHX3+Ynqtddee3mzZs2q9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OMZWTiv+Ft5M1sIoBoitw9QD3gUXe/Nc1V2oqZHUBoDQBsDwxNdx3N7BngZEJa3s+BG4CRwHPAfsAnwDnunpZB3ArqdzKhi8OBJcBFZX30dVy3E4E3gbnA5qj4WkK/fNo/vwT160oGfH5RHQ8nDBDXI3x5fc7db47+rQwjdMPMBv4QfRPPhLpNBBoRuqbnABfHDDRnrLwKBiIiEl8+dROJiEgFFAxERETBQEREFAxERAQFAxERQcFARERQMBAREeD/ARQ2x//GLRvHAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Accuracy: 0.9458346650136403\n" ] } ], "source": [ "X = df_hubei.iloc[:, 1].values.reshape(-1, 1) # values converts it into a numpy array\n", "Y = df_hubei.iloc[:, 0].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n", "linear_regressor = LinearRegression() # create object for the class\n", "linear_regressor.fit(X, Y) # perform linear regression\n", "acc = linear_regressor.score(X, Y)\n", "Y_pred = linear_regressor.predict(X) # make predictions\n", "plt.scatter(X, Y)\n", "plt.plot(X, Y_pred, color='red')\n", "plt.show()\n", "print(\"Accuracy:\" ,acc)" ] }, { "cell_type": "code", "execution_count": 118, "metadata": {}, "outputs": [], "source": [ "\n", "predictions = linear_regressor.predict(X)\n" ] }, { "cell_type": "code", "execution_count": 119, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Prediction: [-7927.82307692] - Day: [0] - Actual: [444]\n", "Prediction: [-5703.45587045] - Day: [1] - Actual: [444]\n", "Prediction: [-3479.08866397] - Day: [2] - Actual: [549]\n", "Prediction: [-1254.72145749] - Day: [3] - Actual: [761]\n", "Prediction: [969.64574899] - Day: [4] - Actual: [1058]\n", "Prediction: [3194.01295547] - Day: [5] - Actual: [1423]\n", "Prediction: [5418.38016194] - Day: [6] - Actual: [3554]\n", "Prediction: [7642.74736842] - Day: [7] - Actual: [3554]\n", "Prediction: [9867.1145749] - Day: [8] - Actual: [4903]\n", "Prediction: [12091.48178138] - Day: [9] - Actual: [5806]\n", "Prediction: [14315.84898785] - Day: [10] - Actual: [7153]\n", "Prediction: [16540.21619433] - Day: [11] - Actual: [11177]\n", "Prediction: [18764.58340081] - Day: [12] - Actual: [13522]\n", "Prediction: [20988.95060729] - Day: [13] - Actual: [16678]\n", "Prediction: [23213.31781377] - Day: [14] - Actual: [19665]\n", "Prediction: [25437.68502024] - Day: [15] - Actual: [22112]\n", "Prediction: [27662.05222672] - Day: [16] - Actual: [24953]\n", "Prediction: [29886.4194332] - Day: [17] - Actual: [27100]\n", "Prediction: [32110.78663968] - Day: [18] - Actual: [29631]\n", "Prediction: [34335.15384615] - Day: [19] - Actual: [31728]\n", "Prediction: [36559.52105263] - Day: [20] - Actual: [33366]\n", "Prediction: [38783.88825911] - Day: [21] - Actual: [33366]\n", "Prediction: [41008.25546559] - Day: [22] - Actual: [48206]\n", "Prediction: [43232.62267206] - Day: [23] - Actual: [54406]\n", "Prediction: [45456.98987854] - Day: [24] - Actual: [56249]\n", "Prediction: [47681.35708502] - Day: [25] - Actual: [58182]\n", "Prediction: [49905.7242915] - Day: [26] - Actual: [59989]\n", "Prediction: [52130.09149798] - Day: [27] - Actual: [61682]\n", "Prediction: [54354.45870445] - Day: [28] - Actual: [62031]\n", "Prediction: [56578.82591093] - Day: [29] - Actual: [62442]\n", "Prediction: [58803.19311741] - Day: [30] - Actual: [62662]\n", "Prediction: [61027.56032389] - Day: [31] - Actual: [64084]\n", "Prediction: [63251.92753036] - Day: [32] - Actual: [64084]\n", "Prediction: [65476.29473684] - Day: [33] - Actual: [64287]\n", "Prediction: [67700.66194332] - Day: [34] - Actual: [64786]\n", "Prediction: [69925.0291498] - Day: [35] - Actual: [65187]\n", "Prediction: [72149.39635628] - Day: [36] - Actual: [65596]\n", "Prediction: [74373.76356275] - Day: [37] - Actual: [65914]\n", "Prediction: [76598.13076923] - Day: [38] - Actual: [66337]\n" ] } ], "source": [ "for x in range(len(predictions)):\n", " print(\"Prediction: \",predictions[x],\"- Day:\", X[x],\"- Actual: \", Y[x])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Prediction for 01/03/2020, 02/03/2020, 03/03/2020" ] }, { "cell_type": "code", "execution_count": 120, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Giorno 39 : 78822.49797570852\n", "Giorno 40 : 81046.86518218626\n", "Giorno 41 : 83271.23238866398\n" ] } ], "source": [ "prediction = linear_regressor.predict([[39],[40],[41]])\n", "l = 39\n", "for x in prediction:\n", " print(\"Giorno \",l,\": \",x[0])\n", " l+=1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Logistic regression" ] }, { "cell_type": "code", "execution_count": 138, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n", "\n", "Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n", "\n", "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\validation.py:724: DataConversionWarning:\n", "\n", "A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n", "\n", "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n", "\n", "Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n", "\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAcDklEQVR4nO3df4xc9Xnv8ffD7tqs+bV2WOjaTrCJjA2ExnYWh9Q3iB8ldrgJ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56vIrqbzX3scTfEbuAYsJ3oznPY3U+V+a5344tf/w/gfVX896Th68B/B8bj5+8LJG4H+sxsl5ltjNvy/ju5GBgC/i7usvo/ZnZWAHGnKs8JPNGmyTlTKeaZtqcXkNnZwEPAl939+FSXVoil4bG7+5i7ryS6o10DXDrFd+UibjP7FHDM3XeVNk/xXbmIO7bW3VcDnwS+aGZXT3FtXuJuJera/Ia7rwLeJuoyqSQvcacqzwm87psm1+A1M+sCiI/H4vZKMU/VvrhMeyrMrI0oeX/H3R8OKXYAdx8GHifqs+wws+IOUqXf9W588evnAa9PE3c9fldrgZvM7BXge0TdKF8PIG7c/Uh8PAZsI/pLM++/k8PAYXd/On7+IFFCz3vc6cq6D2eKPq5WooLCUt4r2lyeUSxLmNgHvpWJhZI/j8//KxMLJc/E7QuI+uvmx49DwIL4tWfja4uFkhtTitmA/wt8fVJ7rmMHOoGO+Lwd+BHwKeCfmFgM/L34/ItMLAY+EJ9fzsRi4EGiQmDdf1fANbxXxMx13MBZwDkl508B6/P+O4k/90fA8vj8q3HMuY871d9a1gFM8wd0I9HoiZeBP8oohu8CR4FRor+V7yDqq9wBvBgfi3/gBvx1HO8eoLvkc74AvBQ//ltJezewN37P/2ZSUaaGuP8L0T/5ngd2x48b8x478KvAQBz3XuBP4vaLiUYFvESUFOfG7WfGz1+KX7+45LP+KI5tPyUjCOr9u2JiAs913HF8P4kfLxQ/N++/k/hzVwL98W+lhygB5z7uNB+aSi8iEqg894GLiMgUlMBFRAKlBC4iEiglcBGRQCmBi4gESglcRCRQSuAiIoH6/zOHTP4IHgQKAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Accuracy: 0.02564102564102564\n" ] } ], "source": [ "from sklearn.linear_model import LogisticRegression\n", "\n", "\n", "X = df_hubei.iloc[:, 1].values.reshape(-1, 1) # values converts it into a numpy array\n", "Y = df_hubei.iloc[:, 0].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n", "logistic = LogisticRegression(random_state=0) # create object for the class\n", "logistic.fit(X, Y) # perform linear regression\n", "acc = logistic.score(X, Y)\n", "Y_pred = logistic.predict(X) # make predictions\n", "\n", "\n", "plt.scatter(X, Y)\n", "plt.plot(X, Y_pred, color='red')\n", "plt.show()\n", "print(\"Accuracy:\" ,acc)\n", "\n", "#plt.plot(X_test, ols.coef_ * X_test + ols.intercept_, linewidth=1)\n" ] }, { "cell_type": "code", "execution_count": 135, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([64084], dtype=int64)" ] }, "execution_count": 135, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y_pred = logistic.predict([[41]])\n", "Y_pred " ] }, { "cell_type": "code", "execution_count": 136, "metadata": {}, "outputs": [], "source": [ "prob = logistic.predict_proba(X)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 131, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Accuracy: 0.2564102564102564\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n", "\n", "Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n", "\n", "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\validation.py:724: DataConversionWarning:\n", "\n", "A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n", "\n", "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n", "\n", "Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n", "\n" ] } ], "source": [ "from sklearn import linear_model\n", "from scipy.special import expit\n", "clf = linear_model.LogisticRegression(C=1e5)\n", "clf.fit(X, Y)\n", "acc = clf.score(X, Y)\n", "\n", "print(\"Accuracy:\" ,acc)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }