{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Incidence of influenza-like illness in France" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting wget\n", " Downloading wget-3.2.zip (10 kB)\n", "Building wheels for collected packages: wget\n", " Building wheel for wget (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Created wheel for wget: filename=wget-3.2-py3-none-any.whl size=9681 sha256=df54105f5bb9f2d741d755365ad8f15b83ebc4494cfc2a3a6f8f1fc8d9cbf40f\n", " Stored in directory: /home/jovyan/.cache/pip/wheels/90/1d/93/c863ee832230df5cfc25ca497b3e88e0ee3ea9e44adc46ac62\n", "Successfully built wget\n", "Installing collected packages: wget\n", "Successfully installed wget-3.2\n" ] } ], "source": [ "!pip install wget" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import isoweek\n", "import wget\n", "import os" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The data on the incidence of influenza-like illness are available from the Web site of the [Réseau Sentinelles](http://www.sentiweb.fr/). We download them as a file in CSV format, in which each line corresponds to a week in the observation period. Only the complete dataset, starting in 1984 and ending with a recent week, is available for download." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is the documentation of the data from [the download site](https://ns.sentiweb.fr/incidence/csv-schema-v1.json):\n", "\n", "| Column name | Description |\n", "|--------------|---------------------------------------------------------------------------------------------------------------------------|\n", "| `week` | ISO8601 Yearweek number as numeric (year times 100 + week nubmer) |\n", "| `indicator` | Unique identifier of the indicator, see metadata document https://www.sentiweb.fr/meta.json |\n", "| `inc` | Estimated incidence value for the time step, in the geographic level |\n", "| `inc_low` | Lower bound of the estimated incidence 95% Confidence Interval |\n", "| `inc_up` | Upper bound of the estimated incidence 95% Confidence Interval |\n", "| `inc100` | Estimated rate incidence per 100,000 inhabitants |\n", "| `inc100_low` | Lower bound of the estimated incidence 95% Confidence Interval |\n", "| `inc100_up` | Upper bound of the estimated rate incidence 95% Confidence Interval |\n", "| `geo_insee` | Identifier of the geographic area, from INSEE https://www.insee.fr |\n", "| `geo_name` | Geographic label of the area, corresponding to INSEE code. This label is not an id and is only provided for human reading |\n", "\n", "The first line of the CSV file is a comment, which we ignore with `skip=1`." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "using file from cache...\n" ] }, { "data": { "text/html": [ "
\n", " | week | \n", "indicator | \n", "inc | \n", "inc_low | \n", "inc_up | \n", "inc100 | \n", "inc100_low | \n", "inc100_up | \n", "geo_insee | \n", "geo_name | \n", "
---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "202011 | \n", "3 | \n", "101704 | \n", "93652.0 | \n", "109756.0 | \n", "154 | \n", "142.0 | \n", "166.0 | \n", "FR | \n", "France | \n", "
1 | \n", "202010 | \n", "3 | \n", "104977 | \n", "96650.0 | \n", "113304.0 | \n", "159 | \n", "146.0 | \n", "172.0 | \n", "FR | \n", "France | \n", "
2 | \n", "202009 | \n", "3 | \n", "110696 | \n", "102066.0 | \n", "119326.0 | \n", "168 | \n", "155.0 | \n", "181.0 | \n", "FR | \n", "France | \n", "
3 | \n", "202008 | \n", "3 | \n", "143753 | \n", "133984.0 | \n", "153522.0 | \n", "218 | \n", "203.0 | \n", "233.0 | \n", "FR | \n", "France | \n", "
4 | \n", "202007 | \n", "3 | \n", "183610 | \n", "172812.0 | \n", "194408.0 | \n", "279 | \n", "263.0 | \n", "295.0 | \n", "FR | \n", "France | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1841 | \n", "198448 | \n", "3 | \n", "78620 | \n", "60634.0 | \n", "96606.0 | \n", "143 | \n", "110.0 | \n", "176.0 | \n", "FR | \n", "France | \n", "
1842 | \n", "198447 | \n", "3 | \n", "72029 | \n", "54274.0 | \n", "89784.0 | \n", "131 | \n", "99.0 | \n", "163.0 | \n", "FR | \n", "France | \n", "
1843 | \n", "198446 | \n", "3 | \n", "87330 | \n", "67686.0 | \n", "106974.0 | \n", "159 | \n", "123.0 | \n", "195.0 | \n", "FR | \n", "France | \n", "
1844 | \n", "198445 | \n", "3 | \n", "135223 | \n", "101414.0 | \n", "169032.0 | \n", "246 | \n", "184.0 | \n", "308.0 | \n", "FR | \n", "France | \n", "
1845 | \n", "198444 | \n", "3 | \n", "68422 | \n", "20056.0 | \n", "116788.0 | \n", "125 | \n", "37.0 | \n", "213.0 | \n", "FR | \n", "France | \n", "
1846 rows × 10 columns
\n", "\n", " | week | \n", "indicator | \n", "inc | \n", "inc_low | \n", "inc_up | \n", "inc100 | \n", "inc100_low | \n", "inc100_up | \n", "geo_insee | \n", "geo_name | \n", "
---|---|---|---|---|---|---|---|---|---|---|
1609 | \n", "198919 | \n", "3 | \n", "0 | \n", "NaN | \n", "NaN | \n", "0 | \n", "NaN | \n", "NaN | \n", "FR | \n", "France | \n", "
\n", " | week | \n", "indicator | \n", "inc | \n", "inc_low | \n", "inc_up | \n", "inc100 | \n", "inc100_low | \n", "inc100_up | \n", "geo_insee | \n", "geo_name | \n", "
---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "202011 | \n", "3 | \n", "101704 | \n", "93652.0 | \n", "109756.0 | \n", "154 | \n", "142.0 | \n", "166.0 | \n", "FR | \n", "France | \n", "
1 | \n", "202010 | \n", "3 | \n", "104977 | \n", "96650.0 | \n", "113304.0 | \n", "159 | \n", "146.0 | \n", "172.0 | \n", "FR | \n", "France | \n", "
2 | \n", "202009 | \n", "3 | \n", "110696 | \n", "102066.0 | \n", "119326.0 | \n", "168 | \n", "155.0 | \n", "181.0 | \n", "FR | \n", "France | \n", "
3 | \n", "202008 | \n", "3 | \n", "143753 | \n", "133984.0 | \n", "153522.0 | \n", "218 | \n", "203.0 | \n", "233.0 | \n", "FR | \n", "France | \n", "
4 | \n", "202007 | \n", "3 | \n", "183610 | \n", "172812.0 | \n", "194408.0 | \n", "279 | \n", "263.0 | \n", "295.0 | \n", "FR | \n", "France | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1841 | \n", "198448 | \n", "3 | \n", "78620 | \n", "60634.0 | \n", "96606.0 | \n", "143 | \n", "110.0 | \n", "176.0 | \n", "FR | \n", "France | \n", "
1842 | \n", "198447 | \n", "3 | \n", "72029 | \n", "54274.0 | \n", "89784.0 | \n", "131 | \n", "99.0 | \n", "163.0 | \n", "FR | \n", "France | \n", "
1843 | \n", "198446 | \n", "3 | \n", "87330 | \n", "67686.0 | \n", "106974.0 | \n", "159 | \n", "123.0 | \n", "195.0 | \n", "FR | \n", "France | \n", "
1844 | \n", "198445 | \n", "3 | \n", "135223 | \n", "101414.0 | \n", "169032.0 | \n", "246 | \n", "184.0 | \n", "308.0 | \n", "FR | \n", "France | \n", "
1845 | \n", "198444 | \n", "3 | \n", "68422 | \n", "20056.0 | \n", "116788.0 | \n", "125 | \n", "37.0 | \n", "213.0 | \n", "FR | \n", "France | \n", "
1845 rows × 10 columns
\n", "